Specify 3D File Save Options

3D File Save Options

There are several Scene.save method overloads that accept a SaveOptions instance. This should be an instance of a class derived from the SaveOptions class. Each save format has a corresponding class that holds save options for that save format, for example there is ColladaSaveOptions for the FileFormat.COLLADA save format.

Use of Collada Save Options

The code below shows how to set save options before saving a 3D file in Collada format.

Use of Discreet3DS Save Options

The code below shows how to set save options before saving a 3D file to a Discreet 3DS format.

Use of the FBX Save Options

The code below shows how to set save options before saving a 3D file to an FBX format.

Use of OBJ Save Options

The code below shows how to set save options before saving a 3D file to an Obj format.

Use of STL Save Options

The code below shows how to set save options before saving a 3D file to STL format.

Use of the U3D Save Options

The code below shows how to set save options before saving a document to U3D format.

Use of the glTF Save Options

The code below shows how to set save options before saving a document to glTF format.

PrettyPrint in glTF Save Options

You can also use setPrettyPrint method of GLTFSaveOptions class for human-understandable JSON print. The code below shows how to use this functionality. 

Save Dependencies of a 3D Scene in the Real File System

Developers may require to save all dependencies of 3D scene in the real file system. They can define the path of a local directory, save in the MemoryFileSystem object or simply discard dependencies. The FileSystem property is added in the all save option classes.

Discard Saving the Material Files

Save Dependencies in the Local Directory

Save Dependencies in the MemoryFileSystem Instance

Use of the Google Draco (.DRC) Save Options

The code below shows how to set save options before saving a 3D model to DRC format.

Use of RVM Save Options

The code below shows how to set save options before saving a 3D model to RVM format.