Class MaterialMap | USD | 2.0.0-exp.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class MaterialMap

    A mapping from USD shader ID to Unity Material.

    Inheritance
    Object
    MaterialMap
    Namespace: Unity.Formats.USD
    Syntax
    public class MaterialMap : IEnumerable<KeyValuePair<string, Material>>, IEnumerable

    Fields

    useOriginalShaderIfAvailable

    Looks for additional metadata describing the original shader name, rather than using the generic spec/metallic workflow shaders.

    Declaration
    public bool useOriginalShaderIfAvailable
    Field Value
    Type Description
    Boolean

    Properties

    DisplayColorMaterial

    A material to use when no material could be found.

    Declaration
    public Material DisplayColorMaterial { get; set; }
    Property Value
    Type Description
    Material

    Item[String]

    Returns a shared instance of the mapped material, else null. Does not throw exceptions.

    Declaration
    public Material this[string path] { get; set; }
    Parameters
    Type Name Description
    String path
    Property Value
    Type Description
    Material

    MetallicWorkflowMaterial

    Declaration
    public Material MetallicWorkflowMaterial { get; set; }
    Property Value
    Type Description
    Material

    SpecularWorkflowMaterial

    Declaration
    public Material SpecularWorkflowMaterial { get; set; }
    Property Value
    Type Description
    Material

    Methods

    AssignColor(Material, Color)

    Declaration
    public static void AssignColor(Material material, Color color)
    Parameters
    Type Name Description
    Material material
    Color color

    ClearRequestedBindings()

    Clears the requested bindings, returning the current queue.

    Declaration
    public Dictionary<string, MaterialMap.MaterialBinder> ClearRequestedBindings()
    Returns
    Type Description
    Dictionary<String, MaterialMap.MaterialBinder>

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator

    GetPrimvars(String)

    Declaration
    public List<string> GetPrimvars(string materialPath)
    Parameters
    Type Name Description
    String materialPath
    Returns
    Type Description
    List<String>

    InstantiateSolidColor(Color)

    Returns an instance of the solid color material, setting the color. If the same color is requested multiple times, a shared material is returned.

    Declaration
    public Material InstantiateSolidColor(Color color)
    Parameters
    Type Name Description
    Color color
    Returns
    Type Description
    Material

    RequestBinding(String, MaterialMap.MaterialBinder)

    Request an object to be bound at a later time in a vectorized request.

    Declaration
    public void RequestBinding(string usdPath, MaterialMap.MaterialBinder binder)
    Parameters
    Type Name Description
    String usdPath

    The USD path to the object.

    MaterialMap.MaterialBinder binder

    A callback which will accept the material and bind it to a Unity object

    SetPrimvars(String, List<String>)

    Declaration
    public void SetPrimvars(string materialPath, List<string> primvars)
    Parameters
    Type Name Description
    String materialPath
    List<String> primvars
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023