Table of Contents

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

HashSet<string>

SupportedTextureFormats

public static readonly string[] SupportedTextureFormats

Field Value

string[]

Properties

Animations

Gets the animations.

public List<Animation> Animations { get; }

Property Value

List<Animation>

The animations.

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

List<SceneNode>

The scene nodes.

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

disposing bool

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

assimpScene Scene

The assimp scene.

filePath string

The filePath of the model. It is used for texture loading

scene HelixToolkitScene

The scene.

texturePathResolver ITexturePathResolver

Custom texture path resolver

Returns

ErrorCode

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

fileStream Stream

The file stream.

filePath string

The filePath. Used to load texture.

formatHint string

The format hint.

scene HelixToolkitScene

The scene.

texturePathResolver ITexturePathResolver

The custom texture path resolver

Returns

ErrorCode

Load(string)

Loads the model specified file path.

public HelixToolkitScene? Load(string filePath)

Parameters

filePath string

The file path.

Returns

HelixToolkitScene

Load(string, out HelixToolkitScene?)

Loads the model by specified file path.

public ErrorCode Load(string filePath, out HelixToolkitScene? scene)

Parameters

filePath string

The file path.

scene HelixToolkitScene

The loaded scene.

Returns

ErrorCode

Exceptions

Exception

Load(string, ImporterConfiguration)

Loads the model specified file path.

public HelixToolkitScene? Load(string filePath, ImporterConfiguration config)

Parameters

filePath string

The file path.

config ImporterConfiguration

The configuration.

Returns

HelixToolkitScene

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

filePath string

The file path.

parallelLoad bool

if set to true [parallel load].

postprocessSteps PostProcessSteps

The postprocess steps.

configs PropertyConfig[]

The configs.

Returns

HelixToolkitScene

OnCreateHelixLine(Mesh)

To the helix line.

protected virtual LineGeometry3D OnCreateHelixLine(Mesh mesh)

Parameters

mesh Mesh

The mesh.

Returns

LineGeometry3D

OnCreateHelixMaterial(Material)

To the helix material.

protected virtual KeyValuePair<Material, MaterialCore?> OnCreateHelixMaterial(Material material)

Parameters

material Material

The material.

Returns

KeyValuePair<Material, MaterialCore>

Exceptions

NotSupportedException

Shading Mode {material.ShadingMode}

OnCreateHelixMesh(Mesh)

To the helix mesh.

protected virtual MeshGeometry3D? OnCreateHelixMesh(Mesh mesh)

Parameters

mesh Mesh

The mesh.

Returns

MeshGeometry3D

OnCreateHelixMeshWithBones(Mesh)

To the helix mesh with bones.

protected virtual BoneSkinnedMeshGeometry3D? OnCreateHelixMeshWithBones(Mesh mesh)

Parameters

mesh Mesh

The mesh.

Returns

BoneSkinnedMeshGeometry3D

OnCreateHelixPoint(Mesh)

To the helix point.

protected virtual PointGeometry3D OnCreateHelixPoint(Mesh mesh)

Parameters

mesh Mesh

The mesh.

Returns

PointGeometry3D

OnCreateHxMeshNode(MeshInfo, HelixInternalScene, Matrix4x4)

To the hx mesh nodes.

protected virtual SceneNode OnCreateHxMeshNode(Importer.MeshInfo mesh, Importer.HelixInternalScene scene, Matrix4x4 transform)

Parameters

mesh Importer.MeshInfo

The mesh.

scene Importer.HelixInternalScene

The scene.

transform Matrix4x4

Returns

SceneNode

Exceptions

NotSupportedException

Mesh Type {mesh.Type}

OnCreatePBRMaterial(Material)

To the PBR material.

protected virtual PBRMaterialCore OnCreatePBRMaterial(Material material)

Parameters

material Material

The material.

Returns

PBRMaterialCore

OnCreatePhongMaterial(Material)

To the phong material.

protected virtual PhongMaterialCore OnCreatePhongMaterial(Material material)

Parameters

material Material

The material.

Returns

PhongMaterialCore

OnLoadEmbeddedTexture(EmbeddedTexture)

protected virtual TextureModel? OnLoadEmbeddedTexture(EmbeddedTexture texture)

Parameters

texture EmbeddedTexture

Returns

TextureModel

OnLoadTexture(string, out string?)

protected virtual TextureModel? OnLoadTexture(string texturePath, out string? actualPath)

Parameters

texturePath string
actualPath string

Returns

TextureModel

ProcessNodeAnimation(NodeAnimationChannel, double, out FastList<Keyframe>)

Processes the node animation.

protected virtual ErrorCode ProcessNodeAnimation(NodeAnimationChannel channel, double ticksPerSecond, out FastList<Keyframe> list)

Parameters

channel NodeAnimationChannel

The channel.

ticksPerSecond double

The ticks per second.

list FastList<Keyframe>

The list.

Returns

ErrorCode

ProcessSceneNodes(SceneNode)

Processes the scene nodes.

protected virtual ErrorCode ProcessSceneNodes(SceneNode root)

Parameters

root SceneNode

The root.

Returns

ErrorCode

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

assimpScene Scene

The assimp scene.

helixScene HelixToolkitScene

The helix scene.

Returns

ErrorCode

Events

AssimpExceptionOccurred

public event EventHandler<Exception>? AssimpExceptionOccurred

Event Type

EventHandler<Exception>