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

    A mesh represents geometry with a single material.

    Inheritance
    object
    Mesh
    Implements
    IMarshalable<Mesh, AiMesh>
    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 Mesh : IMarshalable<Mesh, AiMesh>

    Constructors

    | Edit this page View Source

    Mesh()

    Constructs a new instance of the Mesh class.

    Declaration
    public Mesh()
    | Edit this page View Source

    Mesh(PrimitiveType)

    Constructs a new instance of the Mesh class.

    Declaration
    public Mesh(PrimitiveType primType)
    Parameters
    Type Name Description
    PrimitiveType primType

    Primitive types contained in the mesh.

    | Edit this page View Source

    Mesh(string)

    Constructs a new instance of the Mesh class.

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

    Name of the mesh.

    | Edit this page View Source

    Mesh(string, PrimitiveType)

    Constructs a new instance of the Mesh class.

    Declaration
    public Mesh(string name, PrimitiveType primType)
    Parameters
    Type Name Description
    string name

    Name of the mesh

    PrimitiveType primType

    Primitive types contained in the mesh.

    Properties

    | Edit this page View Source

    BiTangents

    Gets the vertex bitangent list.

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

    BoneCount

    Gets the number of bones that influence this mesh.

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

    Bones

    Gets the bones that influence this mesh.

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

    BoundingBox

    Gets or sets the axis aligned bounding box that contains the extents of the mesh.

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

    FaceCount

    Gets the number of faces contained in the mesh.

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

    Faces

    Gets the mesh's faces. Each face will contain indices to the vertices.

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

    HasBones

    Gets if this mesh has bones.

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

    HasFaces

    Gets if the mesh contains faces. If no special scene flags are set, this should always return true.

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

    HasMeshAnimationAttachments

    Gets if this mesh has mesh animation attachments.

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

    HasNormals

    Gets if the mesh as normals. If it does exist, the count should be the same as the vertex count.

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

    HasTangentBasis

    Gets if the mesh has tangents and bitangents. It is not possible for one to be without the other. If it does exist, the count should be the same as the vertex count.

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

    HasVertices

    Gets if the mesh has a vertex array. This should always return true provided no special scene flags are set.

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

    MaterialIndex

    Gets or sets the index of the material associated with this mesh.

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

    MeshAnimationAttachmentCount

    Gets the number of mesh animation attachments that influence this mesh.

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

    MeshAnimationAttachments

    Gets the mesh animation attachments that influence this mesh.

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

    MorphMethod

    Gets or sets the morph method used when animation attachments are used.

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

    Name

    Gets or sets the mesh name. This tends to be used when formats name nodes and meshes independently, vertex animations refer to meshes by their names, or importers split meshes up, each mesh will reference the same (dummy) name.

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

    Normals

    Gets the vertex normal list.

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

    PrimitiveType

    Gets or sets the primitive type. This may contain more than one type unless if SortByPrimitiveType option is not set.

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

    Tangents

    Gets the vertex tangent list.

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

    TextureCoordinateChannelCount

    Gets the number of valid texture coordinate channels contained in the mesh (list is not empty/not null). This can be a value between zero and the maximum texture coordinate count. Each individual channel should be the size of VertexCount.

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

    TextureCoordinateChannels

    Gets the array that contains each texture coordinate channel, by default all are lists of zero (but can be set to null). Each index in the array corresponds to the texture coordinate channel. The length of the array corresponds to Assimp's maximum UV channel limit.

    Declaration
    public List<Vector3>[] TextureCoordinateChannels { get; }
    Property Value
    Type Description
    List<Vector3>[]
    | Edit this page View Source

    UVComponentCount

    Gets the array that contains the count of UV(W) components for each texture coordinate channel, usually 2 (UV) or 3 (UVW). A component value of zero means the texture coordinate channel does not exist. The channel index (index in the array) corresponds to the texture coordinate channel index.

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

    VertexColorChannelCount

    Gets the number of valid vertex color channels contained in the mesh (list is not empty/not null). This can be a value between zero and the maximum vertex color count. Each individual channel should be the size of VertexCount.

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

    VertexColorChannels

    Gets the array that contains each vertex color channels, by default all are lists of zero (but can be set to null). Each index in the array corresponds to the texture coordinate channel. The length of the array corresponds to Assimp's maximum vertex color channel limit.

    Declaration
    public List<Vector4>[] VertexColorChannels { get; }
    Property Value
    Type Description
    List<Vector4>[]
    | Edit this page View Source

    VertexCount

    Gets the number of vertices in this mesh. This is the count that all per-vertex lists should be the size of.

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

    Vertices

    Gets the vertex position list.

    Declaration
    public List<Vector3> Vertices { get; }
    Property Value
    Type Description
    List<Vector3>

    Methods

    | 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

    GetIndices()

    Convenience method for accumulating all face indices into a single index array.

    Declaration
    public IEnumerable<int> GetIndices()
    Returns
    Type Description
    IEnumerable<int>

    int index array

    | Edit this page View Source

    GetShortIndices()

    Convenience method for accumulating all face indices into a single index array.

    Declaration
    public IEnumerable<short> GetShortIndices()
    Returns
    Type Description
    IEnumerable<short>

    short index enumerable

    | Edit this page View Source

    GetUnsignedIndices()

    Convenience method for accumulating all face indices into a single index array as unsigned integers (the default from Assimp, if you need them).

    Declaration
    public IEnumerable<uint> GetUnsignedIndices()
    Returns
    Type Description
    IEnumerable<uint>

    uint index enumerable

    | Edit this page View Source

    HasTextureCoords(int)

    Checks if the mesh has texture coordinates for the specified channel. This returns false if the list is null or empty. The channel, if it exists, should contain the same number of entries as VertexCount.

    Declaration
    public bool HasTextureCoords(int channelIndex)
    Parameters
    Type Name Description
    int channelIndex

    Channel index

    Returns
    Type Description
    bool

    True if texture coordinates are present in the channel.

    | Edit this page View Source

    HasVertexColors(int)

    Checks if the mesh has vertex colors for the specified channel. This returns false if the list is null or empty. The channel, if it exists, should contain the same number of entries as VertexCount.

    Declaration
    public bool HasVertexColors(int channelIndex)
    Parameters
    Type Name Description
    int channelIndex

    Channel index

    Returns
    Type Description
    bool

    True if vertex colors are present in the channel.

    | Edit this page View Source

    SetIndices(int[], int)

    Convienence method for setting this meshe's face list from an index buffer.

    Declaration
    public bool SetIndices(int[] indices, int indicesPerFace)
    Parameters
    Type Name Description
    int[] indices

    Index buffer

    int indicesPerFace

    Indices per face

    Returns
    Type Description
    bool

    True if the operation succeeded, false otherwise (e.g. not enough data)

    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