Skip to main content

Outputs

Outputs Sample Plugin Rendering an Image Exporting a 3D Object Outputs Outputs is the different file formats you export the garment t...

Updated over 2 months ago

Outputs

Outputs is the different file formats you export the garment to. Use the Render API to export images, turntables, obj, fbx, glTF and so on.

For more information about the feature, please visit here.

To learn more about the rest of the API, please refer to Render in the repository.

Sample Plugin

Sample plugin for export output is available here

Rendering an Image

Code Snippet

The code snippet below shows how to render the current garment as an image. The render image function receives a JSON file (as a string) that contains all the render image information.
For more information, refer to the schema.

Python C++ C#

Python

garment_id = BwApi.GarmentId()
# assuming renderJson contains the above export render image settings
BwApi.RenderImage(garment_id, renderJson)

C++

BwString garmentId;
BwApiGarmentId(garmentId);
// assuming renderJson contains the above export 3d
BwApiRenderImage(garmentId, renderJson);

C#

string garmentId;
BwApi.GarmentId(out garmentId);
// assuming renderJson contains the above export 3d
BwApi.RenderImage(garmentId, renderJson);

Exporting a 3D Object

Code Snippet

The code snippet below shows how to export the current garment as a 3D object . The export 3D object function receives a JSON file (as a string) that contains all the exported information.
For more information, refer to the schema.

Python C++ C#

Python

garment_id = BwApi.GarmentId()
# assuming export3dObjectJson contains the above export 3d object settings
BwApi.RenderExport3DObject(garment_id, export3dObjectJson)

C++

BwString garmentId;
BwApiGarmentId(garmentId);
// assuming export3dObjectJson contains the above export 3d
BwApiRenderExport3DObject(garmentId, export3dObjectJson);

C#

string garmentId;
BwApi.GarmentId(out garmentId);
// assuming export3dObjectJson contains the above export 3d
BwApi.RenderExport3DObject(garmentId, export3dObjectJson);
Did this answer your question?