Skip to content

Improve Robustness of MaterialX to USD Interoperability #2291

@kwokcb

Description

@kwokcb

Summary

This is a placeholder parent issue for sub-issues related to improving the interop between MaterialX to USD.
Specifically for the workflow for referencing or loading in MaterialX to create UsdShade shader graphs.

These are observations based on this prototype: https://github.com/kwokcb/materialxusd

See corresponding USD issue

Note: Sub-issues need to be split out.

Sub-Issues (blockers)

  • Make handling of output qualifiers consistent with UsdShade

    • MaterialX does not always require output qualifiers for connections but UsdShade does.
    • MaterialX considers explicit output qualifiers on upstream nodes/graphs which don't have multiple outputs to be invalid.
    • We should remove this restriction as invalid MaterialXis required for usdMtlx to create valid UsdShade graphs. i.e. usdMtlx will abort and import nothing.
  • MaterialX nodes with single outputs fails validation if an output is specified.

    • This is not invalid and is again inconsistent with UsdShade

Sub-Issues (required)

The following logic is currently required to pre-processing MaterialX so that it is considered valid by usdMtlx.
It would be useful to formalize these. They should be useful beyond this workflow:

  • Provide utility to convert implicit geometry bindings to explicit ones
  • Provide utility to add materials for terminal shading nodes.
  • Provide utility to add explicit output port qualifiers on input connections
  • Provide utility to add downstream shading nodes / materials for output connections.
  • Provide utility to group nodes into a nodegraph.

A version of these utilities can be found here: https://github.com/kwokcb/materialxusd/blob/main/source/materialxusd/materialxusd_utils.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions