Open

Scene.Open method (1 of 9)

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


Scene.Open method (2 of 9)

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, FileFormat.FBX7400ASCII);
}

See Also


Scene.Open method (3 of 9)

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


Scene.Open method (4 of 9)

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


Scene.Open method (5 of 9)

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


Scene.Open method (6 of 9)

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


Scene.Open method (7 of 9)

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


Scene.Open method (8 of 9)

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


Scene.Open method (9 of 9)

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