MaterialContainer
This file contains the material container functionality.
BwApiMaterialContainerIds
Gets the materialContainer IDs of the current active garment and the current colorway.
Python
BwApi.MaterialContainerIds(garmentId)
C++
BwApiMaterialContainerIds(garmentId, materialContainerIds);
C#
BwApi.MaterialContainerIds(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Out | materialContainerIds | Array of int containing the materialContainer IDs. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Only visible material containers will be returned.
---
BwApiMaterialContainerCreate
Note: The offset of the transformation in the material container represent the center
Python
BwApi.MaterialContainerCreate()
C++
BwApiMaterialContainerCreate();
C#
BwApi.MaterialContainerCreate();
---
BwApiMaterialContainerCreate
Creates a new material container and assigns it to a shape in the current colorway.
Python
BwApi.MaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace)
C++
BwApiMaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace, materialContainerId);
C#
BwApi.MaterialContainerCreate(garmentId, shapeId, materialId, transformation, drawPlace);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | materialId | Existing material ID. |
In | transformation | Material container transformation (see BwApiTransformation). |
In | drawPlace | Where to draw the material container: on the inside or outside layer. |
Out | materialContainerId | The ID of the newly created material container. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Artwork and piece assignable will be accpeted as a material.
---
BwApiMaterialContainerDelete
Delete a material container within the current colorway.
Python
BwApi.MaterialContainerDelete(garmentId, materialContainerId)
C++
BwApiMaterialContainerDelete(garmentId, materialContainerId);
C#
BwApi.MaterialContainerDelete(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiMaterialContainerDrawingPlaceGet
Get the drawing place (inside / outside) of the given material container.
Python
BwApi.MaterialContainerDrawingPlaceGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerDrawingPlaceGet(garmentId, materialContainerId, drawPlace);
C#
BwApi.MaterialContainerDrawingPlaceGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container. |
Out | drawPlace | Draw place of the material container. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerDrawingPlaceSet
Set the drawing place (inside / outside) of the given material container.
Python
BwApi.MaterialContainerDrawingPlaceSet(garmentId, materialContainerId, drawPlace)
C++
BwApiMaterialContainerDrawingPlaceSet(garmentId, materialContainerId, drawPlace);
C#
BwApi.MaterialContainerDrawingPlaceSet(garmentId, materialContainerId, drawPlace);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container. |
In | drawPlace | Draw place of the material container. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerRelatedShapesIds
Get all the related shapes of the given material container.
Python
BwApi.MaterialContainerRelatedShapesIds(garmentId, materialContainerId)
C++
BwApiMaterialContainerRelatedShapesIds(garmentId, materialContainerId, shapeIds);
C#
BwApi.MaterialContainerRelatedShapesIds(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container. |
Out | shapeIds | Array of shape IDs. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerMaterialIdGet
Get the material ID associated with a material container.
Python
BwApi.MaterialContainerMaterialIdGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerMaterialIdGet(garmentId, materialContainerId, materialId);
C#
BwApi.MaterialContainerMaterialIdGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container. |
Out | materialId | Get the assigned material ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerTransformationGet
Get a material container's transformation properties.
Python
BwApi.MaterialContainerTransformationGet(garmentId, materialContainerId, shapeId, sizeId)
C++
BwApiMaterialContainerTransformationGet(garmentId, materialContainerId, shapeId, sizeId, transformation);
C#
BwApi.MaterialContainerTransformationGet(garmentId, materialContainerId, shapeId, sizeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
In | shapeId | Existing shape ID. |
In | sizeId | Size of the garment. |
Out | transformation | Transformation (see BwApiTransformation). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The transformation is relative to the shape with ID shapeId.
---
BwApiMaterialContainerTransformationSet
Set a material container's transformation properties.
Python
BwApi.MaterialContainerTransformationSet(garmentId, materialContainerId, shapeId, sizeId, transformation)
C++
BwApiMaterialContainerTransformationSet(garmentId, materialContainerId, shapeId, sizeId, transformation);
C#
BwApi.MaterialContainerTransformationSet(garmentId, materialContainerId, shapeId, sizeId, transformation);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
In | shapeId | Existing shape ID. |
In | sizeId | Size of the garment. |
In | transformation | Shape transformation (see BwApiTransformation) |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Use BwApiMaterialContainerTransformationGet first to get the current values, update the struct and only then call BwApiMaterialContainerTransformationSet with the updated struct.
---
BwApiMaterialContainerAutoPositionsGet
Get material container's auto positions state.
Python
BwApi.MaterialContainerAutoPositionsGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerAutoPositionsGet(garmentId, materialContainerId, autoPositions);
C#
BwApi.MaterialContainerAutoPositionsGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Out | autoPositions | 1 - material container position is linked to other in group, 0 - not linked. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Calling TransformationSet can move other material container sizes in the same group if AutoPositions is 1 (default behaviour).
---
BwApiMaterialContainerAutoPositionsSet
Set material container's auto positions state.
Python
BwApi.MaterialContainerAutoPositionsSet(garmentId, materialContainerId)
C++
BwApiMaterialContainerAutoPositionsSet(garmentId, materialContainerId, autoPositions);
C#
BwApi.MaterialContainerAutoPositionsSet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Out | autoPositions | 1 - material container position is linked to other in group, 0 - not linked.. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Calling TransformationSet can move other material container sizes in the same group if they are linked together.
---
BwApiMaterialContainerTypeGet
Gets a material container type.
Python
BwApi.MaterialContainerTypeGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerTypeGet(garmentId, materialContainerId, type);
C#
BwApi.MaterialContainerTypeGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Out | type | The material container type (the result is bitwise and may contains various type: see BwApiMaterialContainerType). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerTypeSet
Sets a material container type.
Python
BwApi.MaterialContainerTypeSet(garmentId, materialContainerId, type)
C++
BwApiMaterialContainerTypeSet(garmentId, materialContainerId, type);
C#
BwApi.MaterialContainerTypeSet(garmentId, materialContainerId, type);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
In | type | The material container type (the result is bitwise and may contains various type: see BwApiMaterialContainerType). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function looks for the material in the current colorway.
---
BwApiMaterialContainerShowIn2DGet
Check if material container is visible in the 2D window or not.
Python
BwApi.MaterialContainerShowIn2DGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerShowIn2DGet(garmentId, materialContainerId, show);
C#
BwApi.MaterialContainerShowIn2DGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Out | show | 1 - material container is visible, 0 - not visible. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiMaterialContainerShowIn2DSet
Show(1) or hide(0) the material container in the 2D window.
Python
BwApi.MaterialContainerShowIn2DSet(garmentId, materialContainerId, show)
C++
BwApiMaterialContainerShowIn2DSet(garmentId, materialContainerId, show);
C#
BwApi.MaterialContainerShowIn2DSet(garmentId, materialContainerId, show);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing shape ID. |
In | show | 1 - show the material container, 0 - hide the material container. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiMaterialContainerLockGet
Check if the material container is locked(1) or unlocked(0).
Python
BwApi.MaterialContainerLockGet(garmentId, materialContainerId)
C++
BwApiMaterialContainerLockGet(garmentId, materialContainerId, lock);
C#
BwApi.MaterialContainerLockGet(garmentId, materialContainerId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing material container ID. |
Out | lock | 1 - material container is locked, 0 - not locked. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiMaterialContainerLockSet
Lock(1) or unlock(0) the material container.
Python
BwApi.MaterialContainerLockSet(garmentId, materialContainerId, lock)
C++
BwApiMaterialContainerLockSet(garmentId, materialContainerId, lock);
C#
BwApi.MaterialContainerLockSet(garmentId, materialContainerId, lock);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | materialContainerId | Existing materialContainerId ID. |
In | lock | 1 - lock the materialContainerId, 0 - unlock the materialContainerId. |
Returns: Error/success code (see BwApiErrorCodes enum).
---