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)
ParameterTypeDescription
streamStreamInput stream, user is responsible for closing the stream.
formatFileFormatFile format.
cancellationTokenCancellationTokenCancellation token to the load task

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


Open(Stream, LoadOptions, CancellationToken)

Opens the scene from given stream using specified IO config.

public void Open(Stream stream, LoadOptions options, CancellationToken cancellationToken = default)
ParameterTypeDescription
streamStreamInput stream, user is responsible for closing the stream.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationTokenCancellation token to the load task

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


Open(Stream)

Opens the scene from given stream

public void Open(Stream stream)
ParameterTypeDescription
streamStreamInput stream, user is responsible for closing the stream.

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


Open(Stream, CancellationToken)

Opens the scene from given stream

public void Open(Stream stream, CancellationToken cancellationToken)
ParameterTypeDescription
streamStreamInput stream, user is responsible for closing the stream.
cancellationTokenCancellationTokenCancellation token to the load task

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


Open(string, FileFormat, CancellationToken)

Opens the scene from given path using specified file format.

public void Open(string fileName, FileFormat format, CancellationToken cancellationToken = default)
ParameterTypeDescription
fileNameStringFile name.
formatFileFormatFile format.
cancellationTokenCancellationTokenCancellation token to the load task

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


Open(string, LoadOptions)

Opens the scene from given path using specified file format.

public void Open(string fileName, LoadOptions options)
ParameterTypeDescription
fileNameStringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.

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


Open(string, LoadOptions, CancellationToken)

Opens the scene from given path using specified file format.

public void Open(string fileName, LoadOptions options, CancellationToken cancellationToken)
ParameterTypeDescription
fileNameStringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationTokenCancellation token to the load task

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


Open(string)

Opens the scene from given path

public void Open(string fileName)
ParameterTypeDescription
fileNameStringFile name.

Examples

The following code shows how to open a scene from file name

Scene scene = new Scene();
scene.Open("input.fbx");

See Also


Open(string, CancellationToken)

Opens the scene from given path

public void Open(string fileName, CancellationToken cancellationToken)
ParameterTypeDescription
fileNameStringFile name.
cancellationTokenCancellationTokenCancellation token to the load task

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