• 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 Scene

    Represents a completely imported model or scene. Everything that was imported from the given file can be accessed from here. Once the scene is loaded from unmanaged memory, it resides solely in managed memory and Assimp's read only copy is released.

    Inheritance
    object
    Scene
    Implements
    IMarshalable<Scene, AiScene>
    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 Scene : IMarshalable<Scene, AiScene>

    Constructors

    | Edit this page View Source

    Scene()

    Constructs a new instance of the Scene class.

    Declaration
    public Scene()
    | Edit this page View Source

    Scene(string)

    Constructs a new instance of the Scene class.

    Declaration
    public Scene(string name)
    Parameters
    Type Name Description
    string name

    Name of the scene

    Properties

    | Edit this page View Source

    AnimationCount

    Gets the number of animations in the scene.

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

    Animations

    Gets the animations in the scene, if any.

    Declaration
    public List<Animation> Animations { get; }
    Property Value
    Type Description
    List<Animation>
    | Edit this page View Source

    CameraCount

    Gets the number of cameras in the scene.

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

    Cameras

    Gets the cameras in the scene, if any.

    Declaration
    public List<Camera> Cameras { get; }
    Property Value
    Type Description
    List<Camera>
    | Edit this page View Source

    HasAnimations

    Gets if the scene contains any animations.

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

    HasCameras

    Gets if the scene contains any cameras.

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

    HasLights

    Gets if the scene contains any lights.

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

    HasMaterials

    Gets if the scene contains any materials. There should always be at least the default Assimp material if no materials were loaded.

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

    HasMeshes

    Gets if the scene contains meshes. Unless if no special scene flags are set this should always be true.

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

    HasTextures

    Gets if the scene contains embedded textures.

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

    LightCount

    Gets the number of lights in the scene.

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

    Lights

    Gets the lights in the scene, if any.

    Declaration
    public List<Light> Lights { get; }
    Property Value
    Type Description
    List<Light>
    | Edit this page View Source

    MaterialCount

    Gets the number of materials in the scene. There should always be at least the default Assimp material if no materials were loaded.

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

    Materials

    Gets the materials in the scene.

    Declaration
    public List<Material> Materials { get; }
    Property Value
    Type Description
    List<Material>
    | Edit this page View Source

    MeshCount

    Gets the number of meshes in the scene.

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

    Meshes

    Gets the meshes contained in the scene, if any.

    Declaration
    public List<Mesh> Meshes { get; }
    Property Value
    Type Description
    List<Mesh>
    | Edit this page View Source

    Metadata

    Gets the metadata of the scene. This data contains global metadata which belongs to the scene like unit-conversions, versions, vendors or other model-specific data. This can be used to store format-specific metadata as well.

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

    Name

    Gets or sets the name of the scene.

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

    RootNode

    Gets or sets the root node of the scene graph. There will always be at least the root node if the import was successful and no special flags have been set. Presence of further nodes depends on the format and content of the imported file.

    Declaration
    public Node? RootNode { get; set; }
    Property Value
    Type Description
    Node
    | Edit this page View Source

    SceneFlags

    Gets or sets the state of the imported scene. By default no flags are set, but issues can arise if the flag is set to incomplete.

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

    TextureCount

    Gets the number of embedded textures in the scene.

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

    Textures

    Gets the embedded textures in the scene, if any.

    Declaration
    public List<EmbeddedTexture?> Textures { get; }
    Property Value
    Type Description
    List<EmbeddedTexture>

    Methods

    | Edit this page View Source

    Clear()

    Clears the scene of all components.

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

    FreeNative(nint, bool)

    Frees unmanaged memory created by ToNative(nint, out Native).

    Declaration
    public static void FreeNative(nint nativeValue, bool freeNative)
    Parameters
    Type Name Description
    nint nativeValue

    Native value to free

    bool freeNative

    True if the unmanaged memory should be freed, false otherwise.

    | Edit this page View Source

    FreeUnmanagedScene(nint)

    Frees unmanaged memory allocated -ONLY- in ToUnmanagedScene(Scene). To free an unmanaged scene allocated by the unmanaged Assimp library, call the appropiate ReleaseImport(nint) function.

    Declaration
    public static void FreeUnmanagedScene(nint scenePtr)
    Parameters
    Type Name Description
    nint scenePtr

    Pointer to unmanaged scene data.

    | Edit this page View Source

    FromUnmanagedScene(nint)

    Marshals an unmanaged scene to managed memory. This does not free the unmanaged memory.

    Declaration
    public static Scene? FromUnmanagedScene(nint scenePtr)
    Parameters
    Type Name Description
    nint scenePtr

    The unmanaged scene data

    Returns
    Type Description
    Scene

    The managed scene, or null if the pointer is NULL

    | Edit this page View Source

    GetEmbeddedTexture(string)

    Gets an embedded texture by a string. The string may be a texture ID in the format of "*1" or is the file name of the texture.

    Declaration
    public EmbeddedTexture? GetEmbeddedTexture(string fileName)
    Parameters
    Type Name Description
    string fileName

    Texture ID or original file name.

    Returns
    Type Description
    EmbeddedTexture

    Embedded texture or null if it could not be found.

    | Edit this page View Source

    ToUnmanagedScene(Scene)

    Marshals a managed scene to unmanaged memory. The unmanaged memory must be freed with a call to FreeUnmanagedScene(nint), the memory is owned by AssimpNet and cannot be freed by the native library.

    Declaration
    public static nint ToUnmanagedScene(Scene scene)
    Parameters
    Type Name Description
    Scene scene

    Scene data

    Returns
    Type Description
    nint

    Unmanaged scene or NULL if the scene is null.

    Implements

    IMarshalable<Managed, Native>
    • 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