save method

save(self, file_name)

Saves the scene to specified path using specified file format.


def save(self, file_name):
    ...
ParameterTypeDescription
file_namestrFile name.

Exceptions

ExceptionDescription
IOExceptionThrown when failed at reading input
ExportExceptionThrown when failed to export the scene to specified 3D format

Example

The following code shows how to save scene

from aspose.threed import Scene

scene = Scene.from_file("input.fbx")
scene.save("output.usdz")

save(self, stream, format)

Saves the scene to stream using specified file format.


def save(self, stream, format):
    ...
ParameterTypeDescription
streamio.RawIOBaseInput stream, user is responsible for closing the stream.
formatFileFormatFormat.

Exceptions

ExceptionDescription
IOExceptionThrown when failed at reading input
ExportExceptionThrown when failed to export the scene to specified 3D format

Example

The following code shows how to save scene

from aspose.threed import FileFormat, Scene
from io import BytesIO

scene = Scene.from_file("input.fbx")
with BytesIO() as ms:
    scene.save(ms, FileFormat.USDZ)

save(self, stream, options)

Saves the scene to stream using specified file format.


def save(self, stream, options):
    ...
ParameterTypeDescription
streamio.RawIOBaseInput stream, user is responsible for closing the stream.
optionsaspose.threed.formats.SaveOptionsMore detailed configuration to save the stream.

Exceptions

ExceptionDescription
IOExceptionThrown when failed at reading input
ExportExceptionThrown when failed to export the scene to specified 3D format

Example

The following code shows how to save scene

from aspose.threed import Scene
from aspose.threed.formats import UsdSaveOptions
from io import BytesIO

scene = Scene.from_file("input.fbx")
opt = UsdSaveOptions()
opt.primitive_to_mesh = True
with BytesIO() as ms:
    scene.save(ms, opt)

save(self, file_name, format)

Saves the scene to specified path using specified file format.


def save(self, file_name, format):
    ...
ParameterTypeDescription
file_namestrFile name.
formatFileFormatFormat.

Exceptions

ExceptionDescription
IOExceptionThrown when failed at reading input
ExportExceptionThrown when failed to export the scene to specified 3D format

Example

The following code shows how to save scene

from aspose.threed import FileFormat, Scene

scene = Scene.from_file("input.fbx")
scene.save("output.usdz", FileFormat.USDZ)

save(self, file_name, options)

Saves the scene to specified path using specified file format.


def save(self, file_name, options):
    ...
ParameterTypeDescription
file_namestrFile name.
optionsaspose.threed.formats.SaveOptionsMore detailed configuration to save the stream.

Exceptions

ExceptionDescription
IOExceptionThrown when failed at reading input
ExportExceptionThrown when failed to export the scene to specified 3D format

Example

The following code shows how to save scene

from aspose.threed import Scene
from aspose.threed.formats import UsdSaveOptions

scene = Scene.from_file("input.fbx")
opts = UsdSaveOptions()
opts.primitive_to_mesh = True
scene.save("output.usdz", opts)

See Also