Next (Rendering) Previous (Importing)

Exporting

Definition

Synchronous

GET https://clara.io/api/scenes/{uuid}/export/{extension}?zip={true|false}&centerScene={true|false}

Asynchronous

POST https://clara.io/api/scenes/{uuid}/export/{extension}?zip={true|false}&centerScene={true|false}

Parameters

  • uuid: the scene ID.
  • extension: the filename extension of the export format.
  • zip: whether the results should be ziped, or uncompressed (defaults to true, which is recommended)

It is highly recommended that all exports be done with the zip=true parameter. This is because most exports result in multiple files.

Non-URL parameters (aka zip) may be specified in either the query string or the body.

If you send an Accept: text/event-stream header, the output is an event stream of the job and its progress.

Supported formats extensions:

  • babylon - Babylon.js Format. Texture bitmaps will only be exported if using the zip=true method.
  • blend - Blender Format. Texture bitmaps are always included in the exported file.
  • fbx - Autodesk FBX Format.
  • obj - Wavefront Object/OBJ Format. MTL file (material definitions) and texture bitmaps will only be exported if using the zip=true method.
  • dae - The Open Collada Format. Texture bitmaps will only be exported if using the zip=true method.
  • stl - STereoLithography Format for 3D Printing. Always zipped (zip=false will fail), as we need to export one STL file per scene object for correct printing.
  • json - The ThreeJS Scene Object format. Texture bitmaps will only be exported if using the zip=true method.
  • threejs - The ThreeJS JSONLoader format exporter. The file extension is changed to json on export, but three is used to avoid confusion. Texture bitmaps will only be exported if using the zip=true method.
  • x3d - The Web3D eXtensive 3D format. Texture bitmaps will only be exported if using the zip=true method.
  • v2bundle - The Standalone Player format. The unziped files could be put onto a webserver and loaded from index.html.
  • gltf - The GL Transmission Format. The buffer (geometric data and images) is integrated into the file as base64 data.
  • glb - Binary version of glTF.
  • usdz - 3D file format that shows up as AR content on a website with iOS devices.

Optional Query Parameters

  • centerScene: true | false, move the whole scene to the origin (0,0,0) of the world coordinate.
  • alignSceneGround: true | false, align the whole scene the the ground (y = 0) of the world coordinate.
  • imageFormat: Original | WebGL, whether to export images in their original format, or formatted for WebGL (ex. png) which may be smaller in size
  • fbx exporting:
    • fbxUnit: Null | Meter | Centimeter, the system unit of fbx exporter.
    • fbxVersion: 1 | 4 | 5 | 6 | 7, the version of the fbx sdk.
    • fbxEmbedTextures: true | false, embed the textures into fbx file or export seperate files
  • setupCommand: a command to be executed before exporting. The command must be in the form {plugin}%2f{command}, where “%2f” is equivalent to ‘/‘. for example, scene/alignScene can be used to align the scene before exporting without modifing the scene.
  • data: optional data for setupCommand. It is available in the plugin command via options.get('data').

Example Request

https://clara.io/api/scenes/{uuid}/export/fbx?centerScene=true&alignSceneGound=true&fbxUnit=Meter&fbxVersion=5&fbxEmbedTextures=true

Command scene/alignScene accepts 4 params, boolean:isCenter, boolean:isGround, object:origin, number:ground

https://clara.io/api/scenes/{uuid}/export/{extension}?setupCommand=scene/alignScene&data={"isCenter":true, "isGround":true, "data":{"origin":{"x":5, "y":0, "z":0}, "ground":2}}

See other examples in Asynchronous Operation.

Clara Node SDK

When using the Clara Node SDK:

$ clara scenes:export [options]

Next (Rendering) Previous (Importing)