Class Importer
- Namespace
- HelixToolkit.SharpDX.Assimp
- Assembly
- HelixToolkit.SharpDX.Assimp.dll
public class Importer : IDisposable
- Inheritance
-
Importer
- Implements
- Derived
- Inherited Members
Fields
SupportedTextureFormatDict
protected static readonly HashSet<string> SupportedTextureFormatDict
Field Value
SupportedTextureFormats
public static readonly string[] SupportedTextureFormats
Field Value
- string[]
Properties
Animations
Gets the animations.
public List<Animation> Animations { get; }
Property Value
Configuration
Gets or sets the configuration.
public ImporterConfiguration Configuration { get; set; }
Property Value
- ImporterConfiguration
The configuration.
ErrorCode
Gets or sets the error code.
public ErrorCode ErrorCode { get; protected set; }
Property Value
- ErrorCode
The error code.
SceneNodes
Gets all the loaded scene nodes order by preorder traverse.
public List<SceneNode> SceneNodes { get; }
Property Value
SupportedFormats
Gets the supported formats.
public static string[] SupportedFormats { get; }
Property Value
- string[]
The supported formats.
SupportedFormatsString
Gets the supported formats string.
public static string SupportedFormatsString { get; }
Property Value
- string
The supported formats string.
Methods
Clear()
Clears this instance.
protected virtual void Clear()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
Load(Scene, string, out HelixToolkitScene?, ITexturePathResolver?)
Convert the assimp scene to Helix Scene.
public ErrorCode Load(Scene assimpScene, string filePath, out HelixToolkitScene? scene, ITexturePathResolver? texturePathResolver = null)
Parameters
assimpSceneSceneThe assimp scene.
filePathstringThe filePath of the model. It is used for texture loading
sceneHelixToolkitSceneThe scene.
texturePathResolverITexturePathResolverCustom texture path resolver
Returns
Load(Stream, string, string, out HelixToolkitScene?, ITexturePathResolver?)
Loads the specified file stream. User must provider custom texture loader to load texture files.
public ErrorCode Load(Stream fileStream, string filePath, string formatHint, out HelixToolkitScene? scene, ITexturePathResolver? texturePathResolver = null)
Parameters
fileStreamStreamThe file stream.
filePathstringThe filePath. Used to load texture.
formatHintstringThe format hint.
sceneHelixToolkitSceneThe scene.
texturePathResolverITexturePathResolverThe custom texture path resolver
Returns
Load(string)
Loads the model specified file path.
public HelixToolkitScene? Load(string filePath)
Parameters
filePathstringThe file path.
Returns
Load(string, out HelixToolkitScene?)
Loads the model by specified file path.
public ErrorCode Load(string filePath, out HelixToolkitScene? scene)
Parameters
filePathstringThe file path.
sceneHelixToolkitSceneThe loaded scene.
Returns
Exceptions
Load(string, ImporterConfiguration)
Loads the model specified file path.
public HelixToolkitScene? Load(string filePath, ImporterConfiguration config)
Parameters
filePathstringThe file path.
configImporterConfigurationThe configuration.
Returns
Load(string, bool, PostProcessSteps, params PropertyConfig[])
Loads the model specified file path.
public HelixToolkitScene? Load(string filePath, bool parallelLoad, PostProcessSteps postprocessSteps, params PropertyConfig[] configs)
Parameters
filePathstringThe file path.
parallelLoadboolif set to
true[parallel load].postprocessStepsPostProcessStepsThe postprocess steps.
configsPropertyConfig[]The configs.
Returns
OnCreateHelixLine(Mesh)
To the helix line.
protected virtual LineGeometry3D OnCreateHelixLine(Mesh mesh)
Parameters
meshMeshThe mesh.
Returns
OnCreateHelixMaterial(Material)
To the helix material.
protected virtual KeyValuePair<Material, MaterialCore?> OnCreateHelixMaterial(Material material)
Parameters
materialMaterialThe material.
Returns
- KeyValuePair<Material, MaterialCore>
Exceptions
- NotSupportedException
Shading Mode {material.ShadingMode}
OnCreateHelixMesh(Mesh)
To the helix mesh.
protected virtual MeshGeometry3D? OnCreateHelixMesh(Mesh mesh)
Parameters
meshMeshThe mesh.
Returns
OnCreateHelixMeshWithBones(Mesh)
To the helix mesh with bones.
protected virtual BoneSkinnedMeshGeometry3D? OnCreateHelixMeshWithBones(Mesh mesh)
Parameters
meshMeshThe mesh.
Returns
OnCreateHelixPoint(Mesh)
To the helix point.
protected virtual PointGeometry3D OnCreateHelixPoint(Mesh mesh)
Parameters
meshMeshThe mesh.
Returns
OnCreateHxMeshNode(MeshInfo, HelixInternalScene, Matrix4x4)
To the hx mesh nodes.
protected virtual SceneNode OnCreateHxMeshNode(Importer.MeshInfo mesh, Importer.HelixInternalScene scene, Matrix4x4 transform)
Parameters
meshImporter.MeshInfoThe mesh.
sceneImporter.HelixInternalSceneThe scene.
transformMatrix4x4
Returns
Exceptions
- NotSupportedException
Mesh Type {mesh.Type}
OnCreatePBRMaterial(Material)
To the PBR material.
protected virtual PBRMaterialCore OnCreatePBRMaterial(Material material)
Parameters
materialMaterialThe material.
Returns
OnCreatePhongMaterial(Material)
To the phong material.
protected virtual PhongMaterialCore OnCreatePhongMaterial(Material material)
Parameters
materialMaterialThe material.
Returns
OnLoadEmbeddedTexture(EmbeddedTexture)
protected virtual TextureModel? OnLoadEmbeddedTexture(EmbeddedTexture texture)
Parameters
textureEmbeddedTexture
Returns
OnLoadTexture(string, out string?)
protected virtual TextureModel? OnLoadTexture(string texturePath, out string? actualPath)
Parameters
Returns
ProcessNodeAnimation(NodeAnimationChannel, double, out FastList<Keyframe>)
Processes the node animation.
protected virtual ErrorCode ProcessNodeAnimation(NodeAnimationChannel channel, double ticksPerSecond, out FastList<Keyframe> list)
Parameters
channelNodeAnimationChannelThe channel.
ticksPerSeconddoubleThe ticks per second.
listFastList<Keyframe>The list.
Returns
ProcessSceneNodes(SceneNode)
Processes the scene nodes.
protected virtual ErrorCode ProcessSceneNodes(SceneNode root)
Parameters
rootSceneNodeThe root.
Returns
ToHelixToolkitScene(Scene, out HelixToolkitScene?)
Converts HelixToolkit Scene directly from assimp scene. User is responsible for providing the assimp scene.
public ErrorCode ToHelixToolkitScene(Scene assimpScene, out HelixToolkitScene? helixScene)
Parameters
assimpSceneSceneThe assimp scene.
helixSceneHelixToolkitSceneThe helix scene.
Returns
Events
AssimpExceptionOccurred
public event EventHandler<Exception>? AssimpExceptionOccurred