get_format_by_extension method

get_format_by_extension(, extension_name)

Gets the preferred file format from the file extension name The extension name should starts with a dot(’.’).

Returns

Instance of FileFormat, otherwise null returned.


@staticmethod
def get_format_by_extension(extension_name):
    ...
ParameterTypeDescription
extension_namestrThe extension name started with ‘.’ to query.

Example

The following code shows how to save scene to memory using specified format

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

scene = Scene(Box())
outputFormat = ".glb"
format = FileFormat.get_format_by_extension(outputFormat)
with BytesIO() as ms:
    scene.save(ms, format)

See Also