open method
Contents
[
Hide
]open(self, stream)
Opens the scene from given stream
def open(self, stream):
...
Parameter | Type | Description |
---|---|---|
stream | io.RawIOBase | Input stream, user is responsible for closing the stream. |
Exceptions
Exception | Description |
---|---|
IOException | Thrown when failed at reading input |
ImportException | Thrown when input is not a valid 3D format |
Example
The following code shows how to open a scene from stream
from aspose.threed import Scene
scene = Scene()
with open("input.fbx", "rb") as stream:
scene.open(stream)
open(self, file_name)
Opens the scene from given path
def open(self, file_name):
...
Parameter | Type | Description |
---|---|---|
file_name | str | File name. |
Exceptions
Exception | Description |
---|---|
IOException | Thrown when failed at reading input |
ImportException | Thrown when input is not a valid 3D format |
Example
The following code shows how to open a scene from file name
from aspose.threed import Scene
scene = Scene()
scene.open("input.fbx")
open(self, file_name, options)
Opens the scene from given path using specified file format.
def open(self, file_name, options):
...
Parameter | Type | Description |
---|---|---|
file_name | str | File name. |
options | aspose.threed.formats.LoadOptions | More detailed configuration to open the stream. |
Exceptions
Exception | Description |
---|---|
IOException | Thrown when failed at reading input |
ImportException | Thrown when input is not a valid 3D format |
Example
The following code shows how to open a scene from file name with extra load options
from aspose.threed import Scene
from aspose.threed.formats import FbxLoadOptions
scene = Scene()
opts = FbxLoadOptions()
opts.lookup_paths.append("textures")
scene.open("input.fbx", opts)
See Also
- module
aspose.threed
- class
ImportException
- class
Scene