Cluster
This file contains all the clusters functionality, you can create cluster, delete cluster, add shapes to cluster etc...\n Below please find an example of how to create a front torso cluster and add shape to this cluster: CPP:
BwApiClusterCreate
Creates a new cluster.
Python
BwApi.ClusterCreate(garmentId, view, location)
C++
BwApiClusterCreate(garmentId, view, location, newClusterId);
C#
BwApi.ClusterCreate(garmentId, view, location);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | view | The silhouette view to use at it is display in the UI under Tools -> Arrange (see BwApiClusterSilhouetteView enum). |
In | location | The silhouette location within the selected view (see BwApiClusterSilhouetteLocation enum). |
Out | newClusterId | ID of the newly created cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Must immediately fill with valid shapes (at least one shape).
---
BwApiClusterDelete
Delete a cluster.
Python
BwApi.ClusterDelete(garmentId, clusterId)
C++
BwApiClusterDelete(garmentId, clusterId);
C#
BwApi.ClusterDelete(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | ID of the cluster to be deleted. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeAdd
Add a shape to a cluster.
Python
BwApi.ClusterShapeAdd(garmentId, clusterId, shapeId)
C++
BwApiClusterShapeAdd(garmentId, clusterId, shapeId);
C#
BwApi.ClusterShapeAdd(garmentId, clusterId, shapeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | The ID of the shape to be inserted to the cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeRemove
Remove a shape from a cluster.
Python
BwApi.ClusterShapeRemove(garmentId, clusterId, shapeId)
C++
BwApiClusterShapeRemove(garmentId, clusterId, shapeId);
C#
BwApi.ClusterShapeRemove(garmentId, clusterId, shapeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | The ID of the shape to be removed from the cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeOffsetGet
Get the shape offset from the cluster hanging point.
Python
BwApi.ClusterShapeOffsetGet(garmentId, clusterId, shapeId)
C++
BwApiClusterShapeOffsetGet(garmentId, clusterId, shapeId, offset);
C#
BwApi.ClusterShapeOffsetGet(garmentId, clusterId, shapeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | Shape ID within the selected cluster. |
Out | offset | The offset from the cluster hanging point. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeOffsetSet
Set the shape offset from the cluster hanging point.
Python
BwApi.ClusterShapeOffsetSet(garmentId, clusterId, shapeId, offset)
C++
BwApiClusterShapeOffsetSet(garmentId, clusterId, shapeId, offset);
C#
BwApi.ClusterShapeOffsetSet(garmentId, clusterId, shapeId, offset);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | Shape ID within the selected cluster. |
In | offset | The offset from the cluster hanging point. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeOffsetGetEx
Get a cluster's offset value.
Python
BwApi.ClusterShapeOffsetGetEx(garmentId, clusterId, shapeId, sizeId)
C++
BwApiClusterShapeOffsetGetEx(garmentId, clusterId, shapeId, sizeId, offset);
C#
BwApi.ClusterShapeOffsetGetEx(garmentId, clusterId, shapeId, sizeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | Existing shape ID. |
In | sizeId | Existing size ID (-1 for current size). |
Out | offset | Return shape's offset in cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeOffsetSetEx
Set a cluster's offset value.
Python
BwApi.ClusterShapeOffsetSetEx(garmentId, clusterId, shapeId, sizeId, offset)
C++
BwApiClusterShapeOffsetSetEx(garmentId, clusterId, shapeId, sizeId, offset);
C#
BwApi.ClusterShapeOffsetSetEx(garmentId, clusterId, shapeId, sizeId, offset);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | shapeId | Existing shape ID. |
In | sizeId | Existing size ID (-1 for current size, -2 for all sizes). |
In | offset | New offset in cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterShapeIds
Get a list of shape IDs within given the cluster ID.
Python
BwApi.ClusterShapeIds(garmentId, clusterId)
C++
BwApiClusterShapeIds(garmentId, clusterId, shapeIds);
C#
BwApi.ClusterShapeIds(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | shapeIds | Array of shape IDs within the selected cluster. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterSilhouetteGet
Get the cluster's silhouette view and location from the given cluster ID.
Python
BwApi.ClusterSilhouetteGet(garmentId, clusterId)
C++
BwApiClusterSilhouetteGet(garmentId, clusterId, view, location);
C#
BwApi.ClusterSilhouetteGet(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | view | The cluster's silhouette view(see BwApiClusterSilhouetteView enum). |
Out | location | The cluster's silhouette location within the view (see BwApiClusterSilhouetteLocation enum). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterWrapOverBodyGet
Get a cluster's wrap over body property.
Python
BwApi.ClusterWrapOverBodyGet(garmentId, clusterId)
C++
BwApiClusterWrapOverBodyGet(garmentId, clusterId, wrapOverBody);
C#
BwApi.ClusterWrapOverBodyGet(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | wrapOverBody | Cluster's wrap over body type (see BwApiClusterWrapOverBody enum). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterWrapOverBodySet
Set a cluster's wrap over body property.
Python
BwApi.ClusterWrapOverBodySet(garmentId, clusterId, wrapOverBody)
C++
BwApiClusterWrapOverBodySet(garmentId, clusterId, wrapOverBody);
C#
BwApi.ClusterWrapOverBodySet(garmentId, clusterId, wrapOverBody);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | wrapOverBody | Cluster's wrap over type (see BwApiClusterWrapOverBody enum). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterPropertiesGet
Get a cluster's properties such as symmetry, constrained area etc...
Python
BwApi.ClusterPropertiesGet(garmentId, clusterId)
C++
BwApiClusterPropertiesGet(garmentId, clusterId, properties);
C#
BwApi.ClusterPropertiesGet(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | properties | Cluster's properties (see BwApiClusterProperties struct). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiClusterPropertiesSet
Set a cluster's properties such as symmetry, constrained area etc...
Python
BwApi.ClusterPropertiesSet(garmentId, clusterId)
C++
BwApiClusterPropertiesSet(garmentId, clusterId, properties);
C#
BwApi.ClusterPropertiesSet(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | properties | Cluster's properties (see BwApiClusterProperties struct). |
Returns: Error/success code (see BwApiErrorCodes enum). C++:
Note: Since this will set all values within BwApiClusterProperties struct it is recommended to first call BwApiClusterPropertiesGet, change the parameter you want and call BwApiClusterPropertiesSet with the modified struct.
---
BwApiClusterTransformationGet
Get a cluster's transformation properties.
Python
BwApi.ClusterTransformationGet(garmentId, clusterId)
C++
BwApiClusterTransformationGet(garmentId, clusterId, transformation);
C#
BwApi.ClusterTransformationGet(garmentId, clusterId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
Out | transformation | Cluster's transformation. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function allow you to get the scale, offset and rotate properties.
---
BwApiClusterTransformationSet
Set a cluster's transformation properties.
Python
BwApi.ClusterTransformationSet(garmentId, clusterId, transformation)
C++
BwApiClusterTransformationSet(garmentId, clusterId, transformation);
C#
BwApi.ClusterTransformationSet(garmentId, clusterId, transformation);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | clusterId | Existing cluster ID. |
In | transformation | Cluster's transformation. |
Returns: Error/success code (see BwApiErrorCodes enum). CPP:
Note: This function allows you to set the scale, offset and rotate properties.
---