Skip to main content

Material

MaterialCreate MaterialClone MaterialDelete Mate...

Updated over 2 months ago

MaterialCreate

Create a new material.

Python C++ C# VS Server

Python

BwApi.MaterialCreate(garmentId, colorwayId, materialJson)

C++

BwApiMaterialCreate(garmentId, colorwayId, materialJson);

C#

BwApi.MaterialCreate(garmentId, colorwayId, materialJson);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialCreate",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialJson": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialJson

JSON object as string that represent a material object (see Schema/u3m/1.1/u3m_schema.json schema)

Out

materialId

Newly created material ID

Error/success code (see BwApiErrorCodes enum).

MaterialClone

Clone a material.

Python C++ C# VS Server

Python

BwApi.MaterialClone(garmentId, colorwayId, materialId, destColorwayId)

C++

BwApiMaterialClone(garmentId, colorwayId, materialId, destColorwayId);

C#

BwApi.MaterialClone(garmentId, colorwayId, materialId, destColorwayId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialClone",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"destColorwayId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID of the existing material

In

materialId

Existing material ID to clone

In

destColorwayId

Destination colorway ID of the cloned material (colorway must be exist. the value can be the same as colorwayId param to clone to the same colorway)

Out

newMaterialId

Newly cloned material ID

Error/success code (see BwApiErrorCodes enum).

MaterialDelete

Delete a material.

Python C++ C# VS Server

Python

BwApi.MaterialDelete(garmentId, colorwayId, materialId)

C++

BwApiMaterialDelete(garmentId, colorwayId, materialId);

C#

BwApi.MaterialDelete(garmentId, colorwayId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialDelete",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID to delete

Error/success code (see BwApiErrorCodes enum).

MaterialGet

Get a material object.

Python C++ C# VS Server

Python

BwApi.MaterialGet(garmentId, colorwayId, materialId)

C++

BwApiMaterialGet(garmentId, colorwayId, materialId);

C#

BwApi.MaterialGet(garmentId, colorwayId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

Out

materialJson

Material JSON object as string containing all the material's information (see Schema/u3m/1.1/u3m_schema.json schema)

Error/success code (see BwApiErrorCodes enum).

MaterialUpdate

Update a material object.

Python C++ C# VS Server

Python

BwApi.MaterialUpdate(garmentId, colorwayId, materialId, materialJson)

C++

BwApiMaterialUpdate(garmentId, colorwayId, materialId, materialJson);

C#

BwApi.MaterialUpdate(garmentId, colorwayId, materialId, materialJson);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialUpdate",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"materialJson": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

materialJson

Material JSON object as string containing all the material's information (see Schema/u3m/1.1/u3m_schema.json schema)

Error/success code (see BwApiErrorCodes enum).

MaterialSurfaceAreaGet

Get the total surface area for all visible shapes using this fabric type material.

Python C++ C# VS Server

Python

BwApi.MaterialSurfaceAreaGet(garmentId, colorwayId, materialId, size)

C++

BwApiMaterialSurfaceAreaGet(garmentId, colorwayId, materialId, size);

C#

BwApi.MaterialSurfaceAreaGet(garmentId, colorwayId, materialId, size);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialSurfaceAreaGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"size": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

size

Size of the garment

Out

area

Area of the material in total

Error/success code (see BwApiErrorCodes enum).

If a shape is intersect by a Design Line and every part of the shape is in diffrent fabric, Only the relevant area are taking into account in the material surface area calculation.

If a shape is behind a closed Design Line area, The concealed area is still taking into account of the material surface area.

Use this method for shape fabrics.

MaterialLengthGet

Get the material's length and depth for all visible seam type materials.

Python C++ C# VS Server

Python

BwApi.MaterialLengthGet(garmentId, colorwayId, materialId, size)

C++

BwApiMaterialLengthGet(garmentId, colorwayId, materialId, size);

C#

BwApi.MaterialLengthGet(garmentId, colorwayId, materialId, size);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialLengthGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"size": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

size

Size of the garment

Out

length

Length of the material

Out

depth

Depth of the material

Error/success code (see BwApiErrorCodes enum).

Use this method for edge fabrics (seam).

MaterialBoundingBoxGet

Get the material's width, height and count for all visible artwork type materials / trim (3D object).

Python C++ C# VS Server

Python

BwApi.MaterialBoundingBoxGet(garmentId, colorwayId, materialId, sizeId)

C++

BwApiMaterialBoundingBoxGet(garmentId, colorwayId, materialId, sizeId);

C#

BwApi.MaterialBoundingBoxGet(garmentId, colorwayId, materialId, sizeId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialBoundingBoxGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"sizeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

sizeId

Size of the garment

Out

width

Width of the material

Out

height

Height of the material

Out

count

Count of this material

Error/success code (see BwApiErrorCodes enum).

Use this method for artwork and trims (3D object).

MaterialGroup

Check if a material is group material or not.

Python C++ C# VS Server

Python

BwApi.MaterialGroup(garmentId, colorwayId, materialId)

C++

BwApiMaterialGroup(garmentId, colorwayId, materialId);

C#

BwApi.MaterialGroup(garmentId, colorwayId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroup",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

Out

group

Whether this material is group material or not

Error/success code (see BwApiErrorCodes enum).

MaterialGroupCreate

Creates a new group material.

Python C++ C# VS Server

Python

BwApi.MaterialGroupCreate(garmentId, colorwayId, materialGroupJson)

C++

BwApiMaterialGroupCreate(garmentId, colorwayId, materialGroupJson);

C#

BwApi.MaterialGroupCreate(garmentId, colorwayId, materialGroupJson);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupCreate",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupJson": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupJson

JSON material group JSON object as string containing all the material's group information (see Schema/u3m/1.0/group.json schema)

Out

materialGroupId

Newly created group material ID

Error/success code (see BwApiErrorCodes enum).

Physics of group material default is the first material.

MaterialGroupDelete

Delete a group material.

Python C++ C# VS Server

Python

BwApi.MaterialGroupDelete(garmentId, colorwayId, materialGroupId)

C++

BwApiMaterialGroupDelete(garmentId, colorwayId, materialGroupId);

C#

BwApi.MaterialGroupDelete(garmentId, colorwayId, materialGroupId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupDelete",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material ID to delete

Error/success code (see BwApiErrorCodes enum).

Delete all materials.

MaterialGroupGet

Get a material group object.

Python C++ C# VS Server

Python

BwApi.MaterialGroupGet(garmentId, colorwayId, materialGroupId)

C++

BwApiMaterialGroupGet(garmentId, colorwayId, materialGroupId);

C#

BwApi.MaterialGroupGet(garmentId, colorwayId, materialGroupId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing material ID

Out

materialGroupJson

JSON material group JSON object as string containing all the material's group information (see Schema/u3m/1.0/group.json schema)

Error/success code (see BwApiErrorCodes enum).

MaterialGroupUpdate

Update a group material object.

Python C++ C# VS Server

Python

BwApi.MaterialGroupUpdate(garmentId, colorwayId, materialGroupId, materialGroupJson)

C++

BwApiMaterialGroupUpdate(garmentId, colorwayId, materialGroupId, materialGroupJson);

C#

BwApi.MaterialGroupUpdate(garmentId, colorwayId, materialGroupId, materialGroupJson);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupUpdate",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value",
		"materialGroupJson": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing material ID

In

materialGroupJson

JSON material group JSON object as string containing all the material's group information (see Schema/u3m/1.0/group.json schema)

Error/success code (see BwApiErrorCodes enum).

Warning: This function doesn't update group materials and group type.

MaterialGroupItemAdd

Add a material item to a group material.

Python C++ C# VS Server

Python

BwApi.MaterialGroupItemAdd(garmentId, colorwayId, materialGroupId, materialId, role)

C++

BwApiMaterialGroupItemAdd(garmentId, colorwayId, materialGroupId, materialId, role);

C#

BwApi.MaterialGroupItemAdd(garmentId, colorwayId, materialGroupId, materialId, role);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupItemAdd",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value",
		"materialId": "value",
		"role": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material

In

materialId

Existing material ID to add to group

In

role

The role of the material. Can be passed as none (i.e. role can be pullcord for zipper)

Error/success code (see BwApiErrorCodes enum).

Always place the material at the end of the materials.

MaterialGroupItemGet

Get a material as JSON from the given group or a section incase of a trim3d.

Python C++ C# VS Server

Python

BwApi.MaterialGroupItemGet(garmentId, colorwayId, materialGroupId, materialId)

C++

BwApiMaterialGroupItemGet(garmentId, colorwayId, materialGroupId, materialId);

C#

BwApi.MaterialGroupItemGet(garmentId, colorwayId, materialGroupId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupItemGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material

In

materialId

Existing material ID to get from the group or the section ID incase of trim3d

Out

materialJson

JSON object as string that represent a material object (see Schema/u3m/1.1/u3m_schema.json schema)

Error/success code (see BwApiErrorCodes enum).

MaterialGroupItemUpdate

Update a material item in a group material or a section incase of a trim3d.

Python C++ C# VS Server

Python

BwApi.MaterialGroupItemUpdate(garmentId, colorwayId, materialGroupId, materialId, materialJson)

C++

BwApiMaterialGroupItemUpdate(garmentId, colorwayId, materialGroupId, materialId, materialJson);

C#

BwApi.MaterialGroupItemUpdate(garmentId, colorwayId, materialGroupId, materialId, materialJson);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupItemUpdate",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value",
		"materialId": "value",
		"materialJson": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material

In

materialId

Existing material ID to add to group or section ID incase of trim3d

In

materialJson

JSON object as string that represent a material object (see Schema/material_group_item.json schema)

Error/success code (see BwApiErrorCodes enum).

MaterialGroupItemRemove

Remove a material from the group.

Python C++ C# VS Server

Python

BwApi.MaterialGroupItemRemove(garmentId, colorwayId, materialGroupId, materialId)

C++

BwApiMaterialGroupItemRemove(garmentId, colorwayId, materialGroupId, materialId);

C#

BwApi.MaterialGroupItemRemove(garmentId, colorwayId, materialGroupId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupItemRemove",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material

In

materialId

Existing group material ID to remove

Error/success code (see BwApiErrorCodes enum).

Section cannot be removed from a trim3D.

MaterialGroupItemIds

Get a material group material IDs or the section IDs incase of trim3d.

Python C++ C# VS Server

Python

BwApi.MaterialGroupItemIds(garmentId, colorwayId, materialGroupId)

C++

BwApiMaterialGroupItemIds(garmentId, colorwayId, materialGroupId);

C#

BwApi.MaterialGroupItemIds(garmentId, colorwayId, materialGroupId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialGroupItemIds",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialGroupId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialGroupId

Existing group material

Out

materialIds

Existing group material IDs or sections IDs incase of trim3d

Error/success code (see BwApiErrorCodes enum).

MaterialImport

Import a U3M, JSON(group) file into a garment.

Python C++ C# VS Server

Python

BwApi.MaterialImport(garmentId, colorwayId, fullPath)

C++

BwApiMaterialImport(garmentId, colorwayId, fullPath);

C#

BwApi.MaterialImport(garmentId, colorwayId, fullPath);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialImport",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"fullPath": {
			"download_data": {
				"url": "URL",
				"sha256": "SHA256",
				"name": "NAME"
			}
		}
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

fullPath

Full path to the file to be imported

Out

materialIds

The material IDs that were imported to the garment

Error/success code (see BwApiErrorCodes enum).

MaterialExport

Export a material.

Python C++ C#

Python

BwApi.MaterialExport(garmentId, colorwayId, materialId, path)

C++

BwApiMaterialExport(garmentId, colorwayId, materialId, path);

C#

BwApi.MaterialExport(garmentId, colorwayId, materialId, path);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Material ID to export

In

path

The path to be exported to,it musts end with U3MA extension

Error/success code (see BwApiErrorCodes enum).

MaterialUpdateFromFile

Update a material with a U3M file.

Python C++ C# VS Server

Python

BwApi.MaterialUpdateFromFile(garmentId, colorwayId, materialId, fullPath)

C++

BwApiMaterialUpdateFromFile(garmentId, colorwayId, materialId, fullPath);

C#

BwApi.MaterialUpdateFromFile(garmentId, colorwayId, materialId, fullPath);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialUpdateFromFile",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"fullPath": {
			"download_data": {
				"url": "URL",
				"sha256": "SHA256",
				"name": "NAME"
			}
		}
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

fullPath

Full path to the file to be imported

Error/success code (see BwApiErrorCodes enum).

The U3M type and the designated materail must have the same type.

MaterialAssign

Assign a material to another material.

Python C++ C# VS Server

Python

BwApi.MaterialAssign(garmentId, colorwayId, materialId, destColorwayId, destMaterialId, assignOption)

C++

BwApiMaterialAssign(garmentId, colorwayId, materialId, destColorwayId, destMaterialId, assignOption);

C#

BwApi.MaterialAssign(garmentId, colorwayId, materialId, destColorwayId, destMaterialId, assignOption);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialAssign",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value",
		"destColorwayId": "value",
		"destMaterialId": "value",
		"assignOption": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

In

destColorwayId

Existing colorway ID

In

destMaterialId

Existing material ID

In

assignOption

Assign type to use (see BwApiAssignOption)

Error/success code (see BwApiErrorCodes enum).

Please refer the UI to see which paste material operation are allowed.

MaterialLinksGet

Get a material links material across the colorways.

Python C++ C# VS Server

Python

BwApi.MaterialLinksGet(garmentId, colorwayId)

C++

BwApiMaterialLinksGet(garmentId, colorwayId);

C#

BwApi.MaterialLinksGet(garmentId, colorwayId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialLinksGet",
	"params": {
		"garmentId": "value",
		"colorwayId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

Out

colorwayIds

Array of int containing the colorway IDs

Out

materialIds

Array of int containing the material IDs

Error/success code (see BwApiErrorCodes enum).

For every index i in materialIds, materialIds[i] is located at colorwayIds[i].

MaterialLinksSet

Link materials across the colorways.

Python C++ C# VS Server

Python

BwApi.MaterialLinksSet(garmentId)

C++

BwApiMaterialLinksSet(garmentId);

C#

BwApi.MaterialLinksSet(garmentId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialLinksSet",
	"params": {
		"garmentId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

colorwayIds

Array of int containing the colorway IDs

Out

materialIds

Array of int containing the material IDs

Error/success code (see BwApiErrorCodes enum).

For every index i in materialIds, materialIds[i] need to be located at colorwayIds[i].

All the material should have the same type and be either artwork or trim.

MaterialUnLink

Unlink a material.

Python C++ C# VS Server

Python

BwApi.MaterialUnLink(garmentId, colorwayId, materialId)

C++

BwApiMaterialUnLink(garmentId, colorwayId, materialId);

C#

BwApi.MaterialUnLink(garmentId, colorwayId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "MaterialUnLink",
	"params": {
		"garmentId": "value",
		"colorwayId": "value",
		"materialId": "value"
	}
}    

Param

Variable

Description

In

garmentId

Existing garment ID

In

colorwayId

Existing colorway ID

In

materialId

Existing material ID

Error/success code (see BwApiErrorCodes enum).

Did this answer your question?