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

    A material contains all the information that describes how to render a mesh. E.g. textures, colors, and render states. Internally all this information is stored as key-value pair properties. The class contains many convienence methods and properties for accessing non-texture/texture properties without having to know the Assimp material key names. Not all properties may be present, and if they aren't a default value will be returned.

    Inheritance
    object
    Material
    Implements
    IMarshalable<Material, AiMaterial>
    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 Material : IMarshalable<Material, AiMaterial>

    Constructors

    | Edit this page View Source

    Material()

    Constructs a new instance of the Material class.

    Declaration
    public Material()

    Properties

    | Edit this page View Source

    BlendMode

    Gets the blending mode. Default value is Default.

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

    BumpScaling

    Gets the bump scaling. Default value is 0.0f;

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

    ColorAmbient

    Gets the color ambient. Default value is (.2f, .2f, .2f, 1.0f).

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

    ColorDiffuse

    Gets the color diffuse. Default value is white.

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

    ColorEmissive

    Gets the color emissive. Default value is black.

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

    ColorReflective

    Gets the color reflective. Default value is black.

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

    ColorSpecular

    Gets the color specular. Default value is black.

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

    ColorTransparent

    Gets the color transparent. Default value is black.

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

    HasBlendMode

    Checks if the material has a blend mode property.

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

    HasBumpScaling

    Checks if the material has a bump scaling property.

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

    HasColorAmbient

    Checks if the material has a color ambient property.

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

    HasColorDiffuse

    Checks if the material has a color diffuse property.

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

    HasColorEmissive

    Checks if the material has a color emissive property.

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

    HasColorReflective

    Checks if the material has a color reflective property.

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

    HasColorSpecular

    Checks if the material has a color specular property.

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

    HasColorTransparent

    Checks if the material has a color transparent property.

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

    HasName

    Checks if the material has a name property.

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

    HasOpacity

    Checks if the material has an opacity property.

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

    HasReflectivity

    Checks if the material has a reflectivty property.

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

    HasShaders

    Gets if the material has embedded shader source code.

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

    HasShadingMode

    Checks if the material has a shading-mode property.

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

    HasShininess

    Checks if the material has a shininess property.

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

    HasShininessStrength

    Checks if the material has a shininess strength property.

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

    HasTextureAmbient

    Gets if the material has a ambient texture in the first texture index.

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

    HasTextureAmbientOcclusion

    Gets if the material has an ambient occlusion map in in the first texture index.

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

    HasTextureDiffuse

    Gets if the material has a diffuse texture in the first texture index.

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

    HasTextureDisplacement

    Gets if the material has a displacement texture in the first texture index.

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

    HasTextureEmissive

    Gets if the material has a emissive texture in the first texture index.

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

    HasTextureHeight

    Gets if the material has a height texture in the first texture index.

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

    HasTextureLightMap

    Gets if the material has a light map texture in the first texture index.

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

    HasTextureNormal

    Gets if the material has a normal texture in the first texture index.

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

    HasTextureOpacity

    Gets if the material has an opacity texture in the first texture index.

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

    HasTextureReflection

    Gets if the material has a reflection texture in the first texture index.

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

    HasTextureSpecular

    Gets if the material has a specular texture in the first texture index.

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

    HasTransparencyFactor

    Checks if the material has a transparency factor property.

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

    HasTwoSided

    Checks if the material has a two-sided property.

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

    HasWireFrame

    Checks if the material has a wireframe property.

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

    IsPBRMaterial

    Determines if the material is part of a PBR workflow or not.

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

    IsTwoSided

    Gets if the material should be rendered as two-sided. Default value is false.

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

    IsWireFrameEnabled

    Gets if wireframe should be enabled. Default value is false.

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

    Name

    Gets the material name value, if any. Default value is an empty string.

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

    Opacity

    Gets the opacity. Default value is 1.0f.

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

    PBR

    Gets a group accessor for any PBR properties in the material.

    Declaration
    public Material.PBRMaterialProperties PBR { get; }
    Property Value
    Type Description
    Material.PBRMaterialProperties
    | Edit this page View Source

    PropertyCount

    Gets the number of properties contained in the material.

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

    Reflectivity

    Gets the reflectivity. Default value is 0.0f;

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

    Shaders

    Gets a group accessor for any embedded shader source code in the material.

    Declaration
    public Material.ShaderMaterialProperties Shaders { get; }
    Property Value
    Type Description
    Material.ShaderMaterialProperties
    | Edit this page View Source

    ShadingMode

    Gets the shading mode. Default value is None, meaning it is not defined.

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

    Shininess

    Gets the shininess. Default value is 0.0f;

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

    ShininessStrength

    Gets the shininess strength. Default vaulue is 1.0f.

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

    TextureAmbient

    Gets or sets ambient texture properties in the first texture index.

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

    TextureAmbientOcclusion

    Gets or sets ambient occlusion texture properties in the first texture index.

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

    TextureDiffuse

    Gets or sets diffuse texture properties in the first texture index.

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

    TextureDisplacement

    Gets or sets displacement texture properties in the first texture index.

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

    TextureEmissive

    Gets or sets emissive texture properties in the first texture index.

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

    TextureHeight

    Gets or sets height texture properties in the first texture index.

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

    TextureLightMap

    Gets or sets light map texture properties in the first texture index.

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

    TextureNormal

    Gets or sets normal texture properties in the first texture index.

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

    TextureOpacity

    Gets or sets opacity texture properties in the first texture index.

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

    TextureReflection

    Gets or sets reflection texture properties in the first texture index.

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

    TextureSpecular

    Gets or sets specular texture properties in the first texture index.

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

    TransparencyFactor

    Gets the transparency factor. This is used to make a surface more or less opaque (0 = opaque, 1 = transparent). Default value is 0.0f.

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

    Methods

    | Edit this page View Source

    AddMaterialTexture(in TextureSlot)

    Adds a texture to the material - this bulk creates a property for each field. This will either create properties or overwrite existing properties. If the texture has no file path, nothing is added.

    Declaration
    public bool AddMaterialTexture(in TextureSlot texture)
    Parameters
    Type Name Description
    TextureSlot texture

    Texture to add

    Returns
    Type Description
    bool

    True if the texture properties were added or modified

    | Edit this page View Source

    AddMaterialTexture(in TextureSlot, bool)

    Adds a texture to the material - this bulk creates a property for each field. This will either create properties or overwrite existing properties. If the texture has no file path, nothing is added.

    Declaration
    public bool AddMaterialTexture(in TextureSlot texture, bool onlySetFilePath)
    Parameters
    Type Name Description
    TextureSlot texture

    Texture to add

    bool onlySetFilePath

    True to only set the texture's file path, false otherwise

    Returns
    Type Description
    bool

    True if the texture properties were added or modified

    | Edit this page View Source

    AddProperty(MaterialProperty)

    Adds a property to this material.

    Declaration
    public bool AddProperty(MaterialProperty matProp)
    Parameters
    Type Name Description
    MaterialProperty matProp

    Material property

    Returns
    Type Description
    bool

    True if the property was successfully added, false otherwise (e.g. null or key already present).

    | Edit this page View Source

    Clear()

    Removes all properties from the material;

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

    CreateFullyQualifiedName(string, TextureType, int)

    Helper method to construct a fully qualified name from the input parameters. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0". This is the name that is used as the material dictionary key.

    Declaration
    public static string CreateFullyQualifiedName(string baseName, TextureType texType, int texIndex)
    Parameters
    Type Name Description
    string baseName

    Key basename, this must not be null or empty

    TextureType texType

    Texture type; non-texture properties should leave this None

    int texIndex

    Texture index; non-texture properties should leave this zero.

    Returns
    Type Description
    string

    The fully qualified name

    | 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

    GetAllMaterialTextures()

    Gets all textures in the material.

    Declaration
    public IEnumerable<TextureSlot> GetAllMaterialTextures()
    Returns
    Type Description
    IEnumerable<TextureSlot>

    The array of textures

    | Edit this page View Source

    GetAllProperties()

    Gets -all- properties contained in the Material.

    Declaration
    public MaterialProperty[] GetAllProperties()
    Returns
    Type Description
    MaterialProperty[]

    All properties in the material property map.

    | Edit this page View Source

    GetMaterialTexture(TextureType, int, out TextureSlot)

    Gets a texture that corresponds to the type/index.

    Declaration
    public bool GetMaterialTexture(TextureType texType, int texIndex, out TextureSlot texture)
    Parameters
    Type Name Description
    TextureType texType

    Texture type

    int texIndex

    Texture index

    TextureSlot texture

    Texture description

    Returns
    Type Description
    bool

    True if the texture was found in the material

    | Edit this page View Source

    GetMaterialTextureCount(TextureType)

    Gets all the number of textures that are of the specified texture type.

    Declaration
    public int GetMaterialTextureCount(TextureType texType)
    Parameters
    Type Name Description
    TextureType texType

    Texture type

    Returns
    Type Description
    int

    Texture count

    | Edit this page View Source

    GetMaterialTextures(TextureType)

    Gets all textures that correspond to the type.

    Declaration
    public TextureSlot[] GetMaterialTextures(TextureType type)
    Parameters
    Type Name Description
    TextureType type

    Texture type

    Returns
    Type Description
    TextureSlot[]

    The array of textures

    | Edit this page View Source

    GetNonTextureProperty(string)

    Gets the non-texture properties contained in this Material. The name should be the "base name", as in it should not contain texture type/texture index information. E.g. "$clr.diffuse" rather than "$clr.diffuse,0,0". The extra data will be filled in automatically.

    Declaration
    public MaterialProperty? GetNonTextureProperty(string baseName)
    Parameters
    Type Name Description
    string baseName

    Key basename

    Returns
    Type Description
    MaterialProperty

    The material property, if it exists

    | Edit this page View Source

    GetProperty(string)

    Gets the material property by its fully qualified name. The format is: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".

    Declaration
    public MaterialProperty? GetProperty(string fullyQualifiedName)
    Parameters
    Type Name Description
    string fullyQualifiedName

    Fully qualified name of the property

    Returns
    Type Description
    MaterialProperty

    The material property, if it exists

    | Edit this page View Source

    GetProperty(string, TextureType, int)

    Gets the material property. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".

    Declaration
    public MaterialProperty? GetProperty(string baseName, TextureType texType, int texIndex)
    Parameters
    Type Name Description
    string baseName

    Key basename

    TextureType texType

    Texture type; non-texture properties should leave this None

    int texIndex

    Texture index; non-texture properties should leave this zero.

    Returns
    Type Description
    MaterialProperty

    The material property, if it exists

    | Edit this page View Source

    HasNonTextureProperty(string)

    Checks if the material has the specified non-texture property. The name should be the "base name", as in it should not contain texture type/texture index information. E.g. "$clr.diffuse" rather than "$clr.diffuse,0,0". The extra data will be filled in automatically.

    Declaration
    public bool HasNonTextureProperty(string baseName)
    Parameters
    Type Name Description
    string baseName

    Key basename

    Returns
    Type Description
    bool

    True if the property exists, false otherwise.

    | Edit this page View Source

    HasProperty(string)

    Checks if the material has the specified property by looking up its fully qualified name. The format is: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".

    Declaration
    public bool HasProperty(string fullyQualifiedName)
    Parameters
    Type Name Description
    string fullyQualifiedName

    Fully qualified name of the property

    Returns
    Type Description
    bool

    True if the property exists, false otherwise.

    | Edit this page View Source

    HasProperty(string, TextureType, int)

    Checks if the material has the specified property. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".

    Declaration
    public bool HasProperty(string baseName, TextureType texType, int texIndex)
    Parameters
    Type Name Description
    string baseName

    Key basename

    TextureType texType

    Texture type; non-texture properties should leave this None

    int texIndex

    Texture index; non-texture properties should leave this zero.

    Returns
    Type Description
    bool

    True if the property exists, false otherwise.

    | Edit this page View Source

    RemoveMaterialTexture(in TextureSlot)

    Removes a texture from the material - this bulk removes a property for each field. If the texture has no file path, nothing is removed

    Declaration
    public bool RemoveMaterialTexture(in TextureSlot texture)
    Parameters
    Type Name Description
    TextureSlot texture

    Texture to remove

    Returns
    Type Description
    bool

    True if the texture was removed, false otherwise.

    | Edit this page View Source

    RemoveNonTextureProperty(string)

    Removes a non-texture property from the material.

    Declaration
    public bool RemoveNonTextureProperty(string baseName)
    Parameters
    Type Name Description
    string baseName

    Property name

    Returns
    Type Description
    bool

    True if the property was removed, false otherwise

    | Edit this page View Source

    RemoveProperty(string)

    Removes a property from the material.

    Declaration
    public bool RemoveProperty(string fullyQualifiedName)
    Parameters
    Type Name Description
    string fullyQualifiedName

    Fully qualified name of the property ({basename},{texType},{texIndex})

    Returns
    Type Description
    bool

    True if the property was removed, false otherwise

    | Edit this page View Source

    RemoveProperty(string, TextureType, int)

    Removes a property from the material.

    Declaration
    public bool RemoveProperty(string baseName, TextureType texType, int texIndex)
    Parameters
    Type Name Description
    string baseName

    Name of the property

    TextureType texType

    Property texture type

    int texIndex

    Property texture index

    Returns
    Type Description
    bool

    True if the property was removed, false otherwise

    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