Assign Material
Assign Material is how you add a material to a shape or edge of a garment. Use the Shape or Edge API to assign, replace a fabric, seam, artwork, trim and so on.
For more information about the feature, please visit here.
Sample Plugin
Sample plugin for garment creation is available here
Sample plugin for Materials is available here
Assign Fabric
Code Snippet
BwApi.ShapeMaterialIdSet(garmentId, shapeId, materialId)
BwApiShapeMaterialIdSet(garmentId, shapeId, materialId);
BwApiShapeMaterialIdSet(garmentId, shapeId, materialId);
Result
Assign Seam
Code Snippet
BwApi.EdgeMaterialIdSet(garmentId, shapeId, edgeId, materialId)
BwApiEdgeMaterialIdSet(garmentId, shapeId, edgeId, materialId);
BwApiEdgeMaterialIdSet(garmentId, shapeId, edgeId, materialId);
Result
Assign Artwork/Trim
Code Snippet
materialContainerId = BwApi.MaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace)
BwApiMaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace, materialContainerId);
BwApiMaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace, materialContainerId);