Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some MaterialX nodes don't show up in the USD stage #1502

Open
numega opened this issue Apr 22, 2021 · 2 comments
Open

Some MaterialX nodes don't show up in the USD stage #1502

numega opened this issue Apr 22, 2021 · 2 comments

Comments

@numega
Copy link

numega commented Apr 22, 2021

Description of Issue

The add node in the following MaterialX text doesn't show up in the USD stage. I've verified that it works in MaterialXView though.

<?xml version="1.0"?>
<materialx version="1.38" colorspace="lin_rec709">
    <add name="add1" type="color3">
        <input name="in1" type="color3" value="0, 0.5, 0"/>
        <input name="in2" type="color3" value="0, 0.5, 0"/>
    </add>
    <UsdPreviewSurface name="SR_default" type="surfaceshader">
        <input name="diffuseColor" type="color3" nodename="add1"/>
    </UsdPreviewSurface>
    <surfacematerial name="USD_Default" type="material">
        <input name="surfaceshader" type="surfaceshader" nodename="SR_default"/>
    </surfacematerial>
</materialx>

Steps to Reproduce

  1. Build USD with the UsdMtlX plugin enabled
  2. Save the MaterialX text specified above to a file
  3. Run usdcat on the file
  4. Notice how the add node is missing from the USD stage

System Information (OS, Hardware)

macOS 11, MacBookPro (15-inch, 2019)

Package Versions

USD 21.05

Build Flags

./build_scripts/build_usd.py --materialx

@jtran56
Copy link

jtran56 commented Apr 23, 2021

Filed as internal issue #USD-6669

@dboogert
Copy link

dboogert commented Mar 2, 2022

Is this because the add node needs to be in a nodegraph?

I've had some success with materialx files like this:

<?xml version="1.0"?>
<materialx version="1.38">
    <nodegraph name="ng">
        <add name="add1" type="color3">
            <input name="in1" type="color3" value="0, 0.5, 0"/>
            <input name="in2" type="color3" value="0, 0.5, 0"/>
        </add>
        <output name="out_color" type="color3" nodename="add1" />
    </nodegraph>
    <UsdPreviewSurface name="SR_default" type="surfaceshader">
        <input name="diffuseColor" type="color3" nodegraph="ng" output="out_color"/>
    </UsdPreviewSurface>
    <surfacematerial name="USD_Default" type="material">
        <input name="surfaceshader" type="surfaceshader" nodename="SR_default"/>
    </surfacematerial>
</materialx>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants