Scene.Open
Open(Stream, FileFormat, CancellationToken)
Opens the scene from given stream using specified file format.
public void Open(Stream stream, FileFormat format, CancellationToken cancellationToken = default)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | Input stream, user is responsible for closing the stream. |
| format | FileFormat | File format. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from stream
Scene scene = new Scene();
using (var stream = new FileStream("input.fbx", FileMode.Open))
{
scene.Open(stream, FileFormat.GLTF2);
}
See Also
- class FileFormat
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(Stream, LoadOptions, CancellationToken)
Opens the scene from given stream using specified IO config.
public void Open(Stream stream, LoadOptions options, CancellationToken cancellationToken = default)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | Input stream, user is responsible for closing the stream. |
| options | LoadOptions | More detailed configuration to open the stream. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from stream with extra load options
Scene scene = new Scene();
using (var stream = new FileStream("input.fbx", FileMode.Open))
{
var opt = new FbxLoadOptions();
opt.LookupPaths.Add("textures");
scene.Open(stream, opt);
}
See Also
- class LoadOptions
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(Stream)
Opens the scene from given stream
public void Open(Stream stream)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | Input stream, user is responsible for closing the stream. |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from stream
Scene scene = new Scene();
using (var stream = new FileStream("input.fbx", FileMode.Open))
{
scene.Open(stream);
}
See Also
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(Stream, CancellationToken)
Opens the scene from given stream
public void Open(Stream stream, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | Input stream, user is responsible for closing the stream. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from stream with a cancellation token
Scene scene = new Scene();
CancellationTokenSource cts = new CancellationTokenSource();
using (var stream = new FileStream("input.fbx", FileMode.Open))
{
scene.Open(stream, cts.Token);
}
See Also
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(string, FileFormat, CancellationToken)
Opens the scene from given path using specified file format.
public void Open(string fileName, FileFormat format, CancellationToken cancellationToken = default)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | File name. |
| format | FileFormat | File format. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from file name with a cancellation token
Scene scene = new Scene();
CancellationTokenSource cts = new CancellationTokenSource();
scene.Open("input.fbx", FileFormat.FBX7400ASCII, cts.Token);
See Also
- class FileFormat
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(string, LoadOptions)
Opens the scene from given path using specified file format.
public void Open(string fileName, LoadOptions options)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | File name. |
| options | LoadOptions | More detailed configuration to open the stream. |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from file name with extra load options
Scene scene = new Scene();
var opts = new FbxLoadOptions();
opts.LookupPaths.Add("textures");
scene.Open("input.fbx", opts);
See Also
- class LoadOptions
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(string, LoadOptions, CancellationToken)
Opens the scene from given path using specified file format.
public void Open(string fileName, LoadOptions options, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | File name. |
| options | LoadOptions | More detailed configuration to open the stream. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from file name with extra load options and cancellation token
var cts = new CancellationTokenSource();
Scene scene = new Scene();
var opts = new FbxLoadOptions();
opts.LookupPaths.Add("textures");
scene.Open("input.fbx", opts, cts.Token);
See Also
- class LoadOptions
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(string)
Opens the scene from given path
public void Open(string fileName)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | File name. |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from file name
Scene scene = new Scene();
scene.Open("input.fbx");
See Also
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
Open(string, CancellationToken)
Opens the scene from given path
public void Open(string fileName, CancellationToken cancellationToken)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | File name. |
| cancellationToken | CancellationToken | Cancellation token to the load task |
Exceptions
| exception | condition |
|---|---|
| IOException | Thrown when failed at reading input |
| ImportException | Thrown when input is not a valid 3D format |
Examples
The following code shows how to open a scene from file name and a cancellation token source
var cts = new CancellationTokenSource();
Scene scene = new Scene();
scene.Open("input.fbx", cts.Token);
See Also
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D