TriLib Exporter
Search Results for

    Show / Hide Table of Contents

    Class ExporterMaterialMapper

    Abstract base class for mapping Unity materials to exported formats, including utility methods for handling textures.

    Inheritance
    object
    Object
    ScriptableObject
    ExporterMaterialMapper
    AutodeskInteractiveExporterMaterialMapper
    HDRPExporterMaterialMapper
    StandaloneExporterMaterialMapper
    URPExporterMaterialMapper
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TriLibExporter.Mappers
    Assembly: Assembly-CSharp.dll
    Syntax
    public abstract class ExporterMaterialMapper : ScriptableObject

    Properties

    Priority

    Indicates the priority this mapper will be tested. Higher values are tested first.

    Declaration
    public abstract int Priority { get; }
    Property Value
    Type Description
    int

    Methods

    GetNormalTextureData(AssetWriterContext, Texture)

    Retrieves the normal texture data, converting it if necessary.

    Declaration
    protected static Texture GetNormalTextureData(AssetWriterContext assetWriterContext, Texture texture)
    Parameters
    Type Name Description
    AssetWriterContext assetWriterContext

    The context of the asset writer.

    Texture texture

    The Unity texture to process.

    Returns
    Type Description
    Texture

    The processed normal texture.

    GetPNGData(Texture)

    Converts a texture to PNG data.

    Declaration
    public static byte[] GetPNGData(Texture texture)
    Parameters
    Type Name Description
    Texture texture

    The texture to convert.

    Returns
    Type Description
    byte[]

    The PNG data as a byte array.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the texture is null or has no data.

    GetTextureData(AssetWriterContext, Texture)

    Retrieves texture data, converting it if necessary.

    Declaration
    protected static Texture GetTextureData(AssetWriterContext assetWriterContext, Texture texture)
    Parameters
    Type Name Description
    AssetWriterContext assetWriterContext

    The context of the asset writer.

    Texture texture

    The Unity texture to process.

    Returns
    Type Description
    Texture

    The processed texture data.

    GetTextureData(AssetWriterContext, Texture, int, bool)

    Retrieves texture data for a specific channel, converting it if necessary.

    Declaration
    protected static Texture GetTextureData(AssetWriterContext assetWriterContext, Texture texture, int channelIndex, bool invert = false)
    Parameters
    Type Name Description
    AssetWriterContext assetWriterContext

    The context of the asset writer.

    Texture texture

    The Unity texture to process.

    int channelIndex

    The channel index to extract.

    bool invert

    Whether to invert the channel data.

    Returns
    Type Description
    Texture

    The processed texture data.

    IsCompatible(AssetWriterContext, Material)

    Returns whether this mapper is compatible with the current context.

    Declaration
    public abstract bool IsCompatible(AssetWriterContext context, Material material)
    Parameters
    Type Name Description
    AssetWriterContext context
    Material material
    Returns
    Type Description
    bool

    Map(ExporterMaterialMapperContext)

    Maps a material context to the export format.

    Declaration
    public abstract void Map(ExporterMaterialMapperContext materialMapperContext)
    Parameters
    Type Name Description
    ExporterMaterialMapperContext materialMapperContext

    The material mapping context.

    SaveTexture(AssetWriterContext, Texture)

    Saves a texture to a PNG file.

    Declaration
    public static void SaveTexture(AssetWriterContext assetWriterContext, Texture texture)
    Parameters
    Type Name Description
    AssetWriterContext assetWriterContext

    The context of the asset writer.

    Texture texture

    The texture to save.

    In this article
    Back to top Generated by DocFX