Scene.FromStream
Contents
[
Hide
]FromStream(Stream, FileFormat, CancellationToken)
Opens the scene from given stream using specified file format.
public static Scene FromStream(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 |
Examples
The following code shows how to create a scene from a stream
using(var stream = new FileStream("input.fbx", FileMode.Open))
{
Scene scene = Scene.FromStream(stream);
}
See Also
- class FileFormat
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
FromStream(Stream, LoadOptions, CancellationToken)
Opens the scene from given stream using specified IO config.
public static Scene FromStream(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 |
Examples
The following code shows how to create a scene from a stream with load options
var opts = new FbxLoadOptions();
opts.LookupPaths.Add("textures");
using(var stream = new FileStream("input.fbx", FileMode.Open))
{
Scene scene = Scene.FromStream(stream, opts);
}
See Also
- class LoadOptions
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D
FromStream(Stream, CancellationToken)
Opens the scene from given stream
public static Scene FromStream(Stream stream, CancellationToken cancellationToken = default)
Parameter | Type | Description |
---|---|---|
stream | Stream | Input stream, user is responsible for closing the stream. |
cancellationToken | CancellationToken | Cancellation token to the load task |
Examples
The following code shows how to create a scene from a stream with a cancellation token source
var cts = new CancellationTokenSource();
using(var stream = new FileStream("input.fbx", FileMode.Open))
{
Scene scene = Scene.FromStream(stream, cts.Token);
}
See Also
- class Scene
- namespace Aspose.ThreeD
- assembly Aspose.3D