FromFile

Scene.FromFile method (1 of 4)

Opens the scene from given path using specified file format.

public static Scene FromFile(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 create a scene from a file

var cts = new CancellationTokenSource();
Scene scene = Scene.FromFile("input.fbx", FileFormat.FBX7400ASCII, cts.Token);

See Also


Scene.FromFile method (2 of 4)

Opens the scene from given path using specified file format.

public static Scene FromFile(string fileName, LoadOptions options, 
    CancellationToken cancellationToken = default)
ParameterTypeDescription
fileNameStringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationTokenCancellation token to the load task

Examples

The following code shows how to create a scene from a file

var cts = new CancellationTokenSource();
var opt = new FbxLoadOptions();
opt.LookupPaths.Add("textures");
Scene scene = Scene.FromFile("input.fbx", opt, cts.Token);

See Also


Scene.FromFile method (3 of 4)

Opens the scene from given path

public static Scene FromFile(string fileName)
ParameterTypeDescription
fileNameStringFile name.

Examples

The following code shows how to create a scene from a file

Scene scene = Scene.FromFile("input.fbx");

See Also


Scene.FromFile method (4 of 4)

Opens the scene from given path

public static Scene FromFile(string fileName, CancellationToken cancellationToken)
ParameterTypeDescription
fileNameStringFile name.
cancellationTokenCancellationTokenCancellation token to the load task

Examples

The following code shows how to create a scene from a file

var cts = new CancellationTokenSource();
Scene scene = Scene.FromFile("input.fbx", cts.Token);

See Also