• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • SharpAssimp
      • Animation
      • AnimationBehaviour
      • AnimationInterpolation
      • AssimpContext
      • AssimpException
      • BlendMode
      • Bone
      • BoundingBox
      • Camera
      • CompileFlags
      • ConsoleLogStream
      • DefaultLogStream
      • EmbeddedTexture
      • ExcludeComponent
      • ExportDataBlob
      • ExportFormatDescription
      • Face
      • FileIOMode
      • FileIOSystem
      • FreeNativeDelegate
      • IMarshalable<Managed, Native>
      • INativeCustomMarshaler
      • IOStream
      • IOSystem
      • ImporterDescription
      • ImporterFeatureFlags
      • Light
      • LightSourceType
      • LogStream
      • LoggingCallback
      • Material
      • Material.PBRMaterialProperties
      • Material.ShaderMaterialProperties
      • MaterialProperty
      • Matrix3x3
      • MemoryHelper
      • Mesh
      • MeshAnimationAttachment
      • MeshAnimationChannel
      • MeshKey
      • MeshMorphAnimationChannel
      • MeshMorphKey
      • MeshMorphingMethod
      • MetaDataType
      • Metadata
      • Metadata.Entry
      • NativeCustomMarshalerAttribute
      • Node
      • NodeAnimationChannel
      • NodeCollection
      • Origin
      • PostProcessPreset
      • PostProcessSteps
      • PrimitiveType
      • PropertyType
      • QuaternionKey
      • Ray
      • ReturnCode
      • Scene
      • SceneFlags
      • ShadingMode
      • Texel
      • TextureFlags
      • TextureMapping
      • TextureOperation
      • TextureSlot
      • TextureType
      • TextureWrapMode
      • UVTransform
      • UVTransformFlags
      • VectorKey
      • VertexWeight
    • SharpAssimp.Configs
      • ACEvaluateSubdivisionConfig
      • ACSeparateBackfaceCullConfig
      • ASEReconstructNormalsConfig
      • AnimationAccuracyConfig
      • AppScaleConfig
      • BooleanPropertyConfig
      • ColladaIgnoreUpDirectionConfig
      • ColladaUseColladaNamesConfig
      • DeboneAllOrNoneConfig
      • DeboneThresholdConfig
      • ExportPointCloudsConfig
      • FBXConvertToMetersConfig
      • FBXImportAllGeometryLayersConfig
      • FBXImportAllMaterialsConfig
      • FBXImportAnimationsConfig
      • FBXImportCamerasConfig
      • FBXImportEmbeddedTexturesConfig
      • FBXImportEmbeddedTexturesLegacyNamingConfig
      • FBXImportLightsConfig
      • FBXImportMaterialsConfig
      • FBXOptimizeEmptyAnimationCurvesConfig
      • FBXPreservePivotsConfig
      • FBXStrictModeConfig
      • FavorSpeedConfig
      • FloatPropertyConfig
      • GlobalKeyFrameImportConfig
      • GlobalScaleConfig
      • IFCCylindricalTessellationConfig
      • IFCSkipSpaceRepresentationsConfig
      • IFCSmoothingAngleConfig
      • IFCUseCustomTriangulationConfig
      • IRRAnimationFrameRateConfig
      • IgnoreTextureCoordinatesConfig
      • IntegerPropertyConfig
      • KeepSceneHierarchyConfig
      • LWOImportOneLayerConfig
      • LWSAnimationEndConfig
      • LWSAnimationStartConfig
      • MD2KeyFrameImportConfig
      • MD3HandleMultiPartConfig
      • MD3KeyFrameImportConfig
      • MD3ShaderSourceConfig
      • MD3SkinNameConfig
      • MD5NoAnimationAutoLoadConfig
      • MDLColorMapConfig
      • MDLKeyFrameImportConfig
      • MaterialExcludeListConfig
      • MatrixPropertyConfig
      • MaxBoneCountConfig
      • MeasureTimeConfig
      • MeshTriangleLimitConfig
      • MeshVertexLimitConfig
      • MultithreadingConfig
      • NoSkeletonMeshesConfig
      • NodeExcludeListConfig
      • NormalSmoothingAngleConfig
      • NormalizeVertexComponentsConfig
      • OgreMaterialFileConfig
      • OgreTextureTypeFromFilenameConfig
      • PropertyConfig
      • RemoveComponentConfig
      • RemoveDegeneratePrimitivesCheckAreaConfig
      • RemoveDegeneratePrimitivesConfig
      • RemoveEmptyBonesConfig
      • RootTransformationConfig
      • SMDKeyFrameImportConfig
      • SmdLoadAnimationListConfig
      • SortByPrimitiveTypeConfig
      • StringPropertyConfig
      • TangentSmoothingAngleConfig
      • TangentTextureChannelIndexConfig
      • TerragenComputeTexCoordsConfig
      • TransformUVConfig
      • UnrealHandleFlagsConfig
      • UnrealKeyFrameImportConfig
      • VertexBoneWeightLimitConfig
      • VertexCacheSizeConfig
      • XFileUseDoublesConfig
    • SharpAssimp.Unmanaged
      • AiAnimMesh
      • AiAnimation
      • AiBone
      • AiCamera
      • AiConfigs
      • AiDefines
      • AiExportDataBlob
      • AiExportFormatDesc
      • AiFace
      • AiFile
      • AiFileCloseProc
      • AiFileFlushProc
      • AiFileIO
      • AiFileOpenProc
      • AiFileReadProc
      • AiFileSeek
      • AiFileTellProc
      • AiFileWriteProc
      • AiImporterDesc
      • AiLight
      • AiLogStream
      • AiLogStreamCallback
      • AiMatKeys
      • AiMaterial
      • AiMaterialProperty
      • AiMemoryInfo
      • AiMesh
      • AiMeshAnim
      • AiMeshColorArray
      • AiMeshMorphAnim
      • AiMeshMorphKey
      • AiMeshTextureCoordinateArray
      • AiMeshUVComponentArray
      • AiMetadata
      • AiMetadataEntry
      • AiNode
      • AiNodeAnim
      • AiScene
      • AiString
      • AiTexture
      • AssimpLibrary
      • Platform
      • UnmanagedFunctionNameAttribute
      • UnmanagedLibrary
      • UnmanagedLibraryResolver

    Class AssimpContext

    Represents an Assimp Import/Export context that load or save models using the unmanaged library. Additionally, conversion functionality is offered to bypass loading model data into managed memory.

    Inheritance
    object
    AssimpContext
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SharpAssimp
    Assembly: SharpAssimp.dll
    Syntax
    public sealed class AssimpContext : IDisposable

    Constructors

    | Edit this page View Source

    AssimpContext()

    Constructs a new instance of the AssimpContext class.

    Declaration
    public AssimpContext()

    Properties

    | Edit this page View Source

    IsDisposed

    Gets if the context has been disposed.

    Declaration
    public bool IsDisposed { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    PropertyConfigurations

    Gets the property configurations set to this context. This is only used during import.

    Declaration
    public Dictionary<string, PropertyConfig> PropertyConfigurations { get; }
    Property Value
    Type Description
    Dictionary<string, PropertyConfig>
    | Edit this page View Source

    Scale

    Gets or sets the uniform scale for the model. This is multiplied with the existing root node's transform. This is only used during import.

    Declaration
    public float Scale { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    UsingCustomIOSystem

    Gets whether this context is using a user-defined IO system for file handling.

    Declaration
    public bool UsingCustomIOSystem { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    XAxisRotation

    Gets or sets the model's rotation about the X-Axis, in degrees. This is multiplied with the existing root node's transform. This is only used during import.

    Declaration
    public float XAxisRotation { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    YAxisRotation

    Gets or sets the model's rotation abut the Y-Axis, in degrees. This is multiplied with the existing root node's transform. This is only used during import.

    Declaration
    public float YAxisRotation { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    ZAxisRotation

    Gets or sets the model's rotation about the Z-Axis, in degrees. This is multiplied with the existing root node's transform. This is only used during import.

    Declaration
    public float ZAxisRotation { get; set; }
    Property Value
    Type Description
    float

    Methods

    | Edit this page View Source

    ContainsConfig(string)

    Checks if the context has a config set by the specified name.

    Declaration
    public bool ContainsConfig(string configName)
    Parameters
    Type Name Description
    string configName

    Name of the config property

    Returns
    Type Description
    bool

    True if the config is present, false otherwise

    | Edit this page View Source

    ConvertFromFileToBlob(string, PostProcessSteps, string, PostProcessSteps)

    Converts the model contained in the file to the specified format and save it to a data blob.

    Declaration
    public ExportDataBlob? ConvertFromFileToBlob(string inputFilename, PostProcessSteps importProcessSteps, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    PostProcessSteps importProcessSteps

    Post processing steps used for the import

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromFileToBlob(string, string)

    Converts the model contained in the file to the specified format and save it to a data blob.

    Declaration
    public ExportDataBlob? ConvertFromFileToBlob(string inputFilename, string exportFormatId)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    string exportFormatId

    Format id that specifies what format to export to

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromFileToBlob(string, string, PostProcessSteps)

    Converts the model contained in the file to the specified format and save it to a data blob.

    Declaration
    public ExportDataBlob? ConvertFromFileToBlob(string inputFilename, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromFileToFile(string, PostProcessSteps, string, string, PostProcessSteps)

    Converts the model contained in the file to the specified format and save it to a file.

    Declaration
    public bool ConvertFromFileToFile(string inputFilename, PostProcessSteps importProcessSteps, string outputFilename, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    PostProcessSteps importProcessSteps

    Post processing steps used for the import

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromFileToFile(string, string, string)

    Converts the model contained in the file to the specified format and save it to a file.

    Declaration
    public bool ConvertFromFileToFile(string inputFilename, string outputFilename, string exportFormatId)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromFileToFile(string, string, string, PostProcessSteps)

    Converts the model contained in the file to the specified format and save it to a file.

    Declaration
    public bool ConvertFromFileToFile(string inputFilename, string outputFilename, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    string inputFilename

    Input file name to import

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToBlob(Stream, string, PostProcessSteps, string, PostProcessSteps)

    Converts the model contained in the stream to the specified format and save it to a data blob. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToBlob" family of functions.

    Declaration
    public ExportDataBlob? ConvertFromStreamToBlob(Stream inputStream, string importFormatHint, PostProcessSteps importProcessSteps, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    PostProcessSteps importProcessSteps

    Post processing steps used for import

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToBlob(Stream, string, string)

    Converts the model contained in the stream to the specified format and save it to a data blob. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToBlob" family of functions.

    Declaration
    public ExportDataBlob? ConvertFromStreamToBlob(Stream inputStream, string importFormatHint, string exportFormatId)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    string exportFormatId

    Format id that specifies what format to export to

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToBlob(Stream, string, string, PostProcessSteps)

    Converts the model contained in the stream to the specified format and save it to a data blob. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToBlob" family of functions.

    Declaration
    public ExportDataBlob? ConvertFromStreamToBlob(Stream inputStream, string importFormatHint, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    ExportDataBlob

    Data blob containing the exported scene in a binary form

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToFile(Stream, string, PostProcessSteps, string, string, PostProcessSteps)

    Converts the model contained in the stream to the specified format and save it to a file. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToFile" family of functions.

    Declaration
    public bool ConvertFromStreamToFile(Stream inputStream, string importFormatHint, PostProcessSteps importProcessSteps, string outputFilename, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    PostProcessSteps importProcessSteps

    Post processing steps used for import

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToFile(Stream, string, string, string)

    Converts the model contained in the stream to the specified format and save it to a file. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToFile" family of functions.

    Declaration
    public bool ConvertFromStreamToFile(Stream inputStream, string importFormatHint, string outputFilename, string exportFormatId)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ConvertFromStreamToFile(Stream, string, string, string, PostProcessSteps)

    Converts the model contained in the stream to the specified format and save it to a file. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ConvertFromFileToFile" family of functions.

    Declaration
    public bool ConvertFromStreamToFile(Stream inputStream, string importFormatHint, string outputFilename, string exportFormatId, PostProcessSteps exportProcessSteps)
    Parameters
    Type Name Description
    Stream inputStream

    Stream to read from

    string importFormatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful

    string outputFilename

    Output file name to export to

    string exportFormatId

    Format id that specifies what format to export to

    PostProcessSteps exportProcessSteps

    Pre processing steps used for the export

    Returns
    Type Description
    bool

    True if the conversion was successful or not, false otherwise.

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    Dispose()

    Disposes of resources held by the context. These include IO systems still attached.

    Declaration
    public void Dispose()
    | Edit this page View Source

    ExportFile(Scene, string, string)

    Exports a scene to the specified format and writes it to a file.

    Declaration
    public bool ExportFile(Scene scene, string fileName, string exportFormatId)
    Parameters
    Type Name Description
    Scene scene

    Scene containing the model to export.

    string fileName

    Path to the file.

    string exportFormatId

    FormatID representing the format to export to.

    Returns
    Type Description
    bool

    True if the scene was exported successfully, false otherwise.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the scene is null.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ExportFile(Scene, string, string, PostProcessSteps)

    Exports a scene to the specified format and writes it to a file.

    Declaration
    public bool ExportFile(Scene scene, string fileName, string exportFormatId, PostProcessSteps preProcessing)
    Parameters
    Type Name Description
    Scene scene

    Scene containing the model to export.

    string fileName

    Path to the file.

    string exportFormatId

    FormatID representing the format to export to.

    PostProcessSteps preProcessing

    Preprocessing flags to apply to the model before it is exported.

    Returns
    Type Description
    bool

    True if the scene was exported successfully, false otherwise.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the scene is null.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ExportToBlob(Scene, string)

    Exports a scene to the specified format and writes it to a data blob.

    Declaration
    public ExportDataBlob? ExportToBlob(Scene scene, string exportFormatId)
    Parameters
    Type Name Description
    Scene scene

    Scene containing the model to export.

    string exportFormatId

    FormatID representing the format to export to.

    Returns
    Type Description
    ExportDataBlob

    The resulting data blob, or null if the export failed.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the scene is null.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ExportToBlob(Scene, string, PostProcessSteps)

    Exports a scene to the specified format and writes it to a data blob.

    Declaration
    public ExportDataBlob? ExportToBlob(Scene scene, string exportFormatId, PostProcessSteps preProcessing)
    Parameters
    Type Name Description
    Scene scene

    Scene containing the model to export.

    string exportFormatId

    FormatID representing the format to export to.

    PostProcessSteps preProcessing

    Preprocessing flags to apply to the model before it is exported.

    Returns
    Type Description
    ExportDataBlob

    The resulting data blob, or null if the export failed.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the scene is null.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    GetImporterDescriptionFor(string)

    Gets an importer description for the specified file extension. If no importers support it, null is returned. Multiple importers may support the file extension, they are called in the order that they were registered.

    Declaration
    public ImporterDescription? GetImporterDescriptionFor(string fileExtension)
    Parameters
    Type Name Description
    string fileExtension

    File extension to query importer support for.

    Returns
    Type Description
    ImporterDescription

    Importer description or null if it does not exist.

    | Edit this page View Source

    GetImporterDescriptions()

    Gets descriptions for each importer that assimp has registered.

    Declaration
    public ImporterDescription[] GetImporterDescriptions()
    Returns
    Type Description
    ImporterDescription[]

    Descriptions of supported importers.

    | Edit this page View Source

    GetSupportedExportFormats()

    Gets the model formats that are supported for export by Assimp.

    Declaration
    public ExportFormatDescription[] GetSupportedExportFormats()
    Returns
    Type Description
    ExportFormatDescription[]

    Export formats supported

    | Edit this page View Source

    GetSupportedImportFormats()

    Gets the model formats that are supported for import by Assimp.

    Declaration
    public string[] GetSupportedImportFormats()
    Returns
    Type Description
    string[]

    Import formats supported

    | Edit this page View Source

    ImportFile(string)

    Imports a model from the specified file without running any post-process steps. The importer sets configurations and loads the model into managed memory, releasing the unmanaged memory used by Assimp.

    Declaration
    public Scene ImportFile(string file)
    Parameters
    Type Name Description
    string file

    Full path to the file

    Returns
    Type Description
    Scene

    The imported scene

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ImportFile(string, PostProcessSteps)

    Imports a model from the specified file. The importer sets configurations and loads the model into managed memory, releasing the unmanaged memory used by Assimp.

    Declaration
    public Scene ImportFile(string file, PostProcessSteps postProcessFlags)
    Parameters
    Type Name Description
    string file

    Full path to the file

    PostProcessSteps postProcessFlags

    Post processing flags, if any

    Returns
    Type Description
    Scene

    The imported scene

    Exceptions
    Type Condition
    AssimpException

    Thrown if there was a general error in importing the model.

    FileNotFoundException

    Thrown if the file could not be located.

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ImportFileFromStream(Stream, PostProcessSteps, string?)

    Imports a model from the stream. The importer sets configurations and loads the model into managed memory, releasing the unmanaged memory used by Assimp. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ImportFile" family of functions.

    Declaration
    public Scene ImportFileFromStream(Stream stream, PostProcessSteps postProcessFlags, string? formatHint = null)
    Parameters
    Type Name Description
    Stream stream

    Stream to read from

    PostProcessSteps postProcessFlags

    Post processing flags, if any

    string formatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful.

    Returns
    Type Description
    Scene

    The imported scene

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    ImportFileFromStream(Stream, string?)

    Imports a model from the stream without running any post-process steps. The importer sets configurations and loads the model into managed memory, releasing the unmanaged memory used by Assimp. It is up to the caller to dispose of the stream. If the format is distributed across multiple files/streams, set a custom IOSystem and use the "ImportFile" family of functions.

    Declaration
    public Scene ImportFileFromStream(Stream stream, string? formatHint = null)
    Parameters
    Type Name Description
    Stream stream

    Stream to read from

    string formatHint

    Optional format extension to serve as a hint to Assimp to choose which importer to use. If null or empty, the system will try to detect what importer to use from the data which may or may not be successful.

    Returns
    Type Description
    Scene

    The imported scene

    Exceptions
    Type Condition
    AssimpException

    Thrown if the stream is not valid (null or write-only).

    ObjectDisposedException

    Thrown if the context has already been disposed of.

    | Edit this page View Source

    IsExportFormatSupported(string)

    Checks if the format extension (e.g. ".dae" or ".obj") is supported for export.

    Declaration
    public bool IsExportFormatSupported(string format)
    Parameters
    Type Name Description
    string format

    Model format

    Returns
    Type Description
    bool

    True if the format is supported, false otherwise

    | Edit this page View Source

    IsImportFormatSupported(string)

    Checks if the format extension (e.g. ".dae" or ".obj") is supported for import.

    Declaration
    public static bool IsImportFormatSupported(string format)
    Parameters
    Type Name Description
    string format

    Model format

    Returns
    Type Description
    bool

    True if the format is supported, false otherwise

    | Edit this page View Source

    RemoveConfig(string)

    Removes a set configuration property by name.

    Declaration
    public void RemoveConfig(string configName)
    Parameters
    Type Name Description
    string configName

    Name of the config property

    | Edit this page View Source

    RemoveConfigs()

    Removes all configuration properties from the context.

    Declaration
    public void RemoveConfigs()
    | Edit this page View Source

    RemoveIOSystem()

    Removes the currently set custom file system implementation from the importer.

    Declaration
    public void RemoveIOSystem()
    | Edit this page View Source

    SetConfig(PropertyConfig)

    Sets a configuration property to the context. This is only used during import.

    Declaration
    public void SetConfig(PropertyConfig config)
    Parameters
    Type Name Description
    PropertyConfig config

    Config to set

    | Edit this page View Source

    SetIOSystem(IOSystem?)

    Sets a custom file system implementation that is used by this importer. If it is null, then the default assimp file system is used instead.

    Declaration
    public void SetIOSystem(IOSystem? ioSystem)
    Parameters
    Type Name Description
    IOSystem ioSystem

    Custom file system implementation

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2012-2020 Nicholas Woodfield, (c) 2024 Salvage, (c) 2025 Jérémy Ansel