Class MtlLibrary
Class for parsing and storing material libraries from .mtl files
Inheritance
Implements
Namespace: i5.Toolkit.Core.ModelImporters
Assembly: cs.temp.dll.dll
Syntax
public class MtlLibrary : IMtlLibrary
Constructors
MtlLibrary()
Constructor
Declaration
public MtlLibrary()
Properties
ContentLoader
Gets or sets the module which loads the .mtl files
Declaration
public IContentLoader<string> ContentLoader { get; set; }
Property Value
Type | Description |
---|---|
IContentLoader<><string> |
ExtendedLogging
If set to true, the service will log additional information, e.g. comments in the .mtl file
Declaration
public bool ExtendedLogging { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetMaterialConstructor(string, string)
Returns a material from a library as a material constructor instance
Declaration
public MaterialConstructor GetMaterialConstructor(string materialLibrary, string materialName)
Parameters
Type | Name | Description |
---|---|---|
string | materialLibrary | The library name which contains the material |
string | materialName | The name of the material in the library |
Returns
Type | Description |
---|---|
MaterialConstructor | Returns a material constructor that resembles the material; returns null if the libarary or material does not exist |
LibraryLoaded(string)
Returns true if the library with the given name was loaded
Declaration
public bool LibraryLoaded(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the library |
Returns
Type | Description |
---|---|
bool | Returns true if the library was loaded |
LoadLibraryAsyc(string, string)
Asynchronously loads a material library from the specified URI
Declaration
public Task<bool> LoadLibraryAsyc(string absolutePath, string libraryName)
Parameters
Type | Name | Description |
---|---|---|
string | absolutePath | Absolute path or uri to the .mtl file |
string | libraryName | The name of the library |
Returns
Type | Description |
---|---|
Task<><bool> | Returns true if the library could be loaded |