 |
ObjImporter Class |
ObjImporter can read 3D models from obj files.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
SyntaxThe ObjImporter type exposes the following members.
Constructors | Name | Description |
---|
 | ObjImporter(IBitmapIO) |
Constructor that only takes an optional bitmapIO and will not create the textures immediately.
Also the no cache is used to read and store the textures.
|
 | ObjImporter(IBitmapIO, Scene) |
Constructor with optional Scene object that when specified is used to cache the loaded textures.
When Scene.GpuDevice is initialized, then the textures are immediately created. Otherwise the textures are created when materials with textures are initialized.
|
 | ObjImporter(IBitmapIO, VulkanDevice) |
Constructor with optional gpuDevice object that when specified is used to create and cache the loaded textures.
When gpuDevice is null, then the textures are created when materials with textures are initialized.
|
Top
Properties | Name | Description |
---|
 | DetectEncodingFromByteOrderMarks |
Indicates whether to look for byte order marks at the beginning of the file to detect the text encoding (using in StreamReader constructor). Default value is true.
|
 | Errors |
Gets a list of errors that occur during obj file loading.
|
 | IgnoreErrors |
Gets or sets a Boolean that specifies if errors are ignored and reader tries to read as much data as possible.
The error texts are written to Errors list.
|
 | NamedObjects |
Gets a dictionary that can be used to get a 3D object by its name (key = name, value = MeshModelNode)
|
 | ResolveResourceFunc |
Gets or sets a Func that returns stream from the specified resource name. This can be used to read resources from stream.
The returned stream will be closed by the ObjImporter.
|
 | UseTwoSidedMaterials |
When true (false by default), then BackMaterials is set to the same material as Material.
|
Top
Methods | Name | Description |
---|
 | Import(String) |
Imports the 3D models from objFileName file and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
The method will not return null but an empty GroupNode in case no model is read.
Textures directory is the same as obj file directory.
|
 | Import(Stream, FuncString, Stream) |
Imports the 3D models from stream and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set to a method that converts resource names into Streams.
The method will not return null but an empty GroupNode in case no model is read.
|
 | Import(Stream, FuncString, Stream, Material) |
Imports the 3D models from stream and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set a method that converts the resource name into Stream.
The method will not return null but an empty GroupNode in case no model is read.
|
 | Import(String, String, StandardMaterial) |
Imports the 3D models from objFileName file and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
The method will not return null but an empty GroupNode in case no model is read.
|
 | ReadObjFileData(Stream) |
Reads the obj file from specified stream and returns the ObjFileData object.
|
 | ReadObjFileData(String) |
Reads the objFileName file and returns the ObjFileData object.
|
 | ReadSceneNodes(String) | Obsolete.
|
 | ReadSceneNodes(Stream, FuncString, Stream) | Obsolete.
|
 | ReadSceneNodes(Stream, FuncString, Stream, Material) | Obsolete.
|
 | ReadSceneNodes(String, String, StandardMaterial) | Obsolete.
|
Top
Remarks[Missing <remarks> documentation for "T:Ab4d.SharpEngine.Utilities.ObjImporter"]
See Also