MaterialX NodeDefs Missing #2710
Replies: 7 comments 3 replies
-
Having done a little more reading of Issues, as well as re-reading the 'Viewport' section of the current MaterialX readme page, I think that what I'm trying to do here isn't currently possible - the docs state that "We are using the hdMtlx translation framework, which is also in use for hdStorm and hdPrman, and using the same GLSL code generator as hdStorm, so valid USD MaterialX material graphs should display correctly" and I'm now interpreting the "valud USD MaterialX material graphs" as those using the standard material libraries only. Would this be correct, does anyone know? |
Beta Was this translation helpful? Give feedback.
-
@JGamache-autodesk, with your knowledge in MaterialX could you confirm this? |
Beta Was this translation helpful? Give feedback.
-
This should definitely be possible. Both USD and MayaUSD will search for MaterialX libraries by following the Now there are two options: 1- Houdini kept its own definitions in a very separate path from the MaterialX libraries it ships with. You only need to add that path to the env var. Technically, you should be able to do the reverse and add the MayaUSD libraries to the Houdini env var for library paths and be able to use a LdkColorCorrect node from Enable the following environment variable to help debugging: In the Maya script editor, Python tab, you can very quickly find if the MaterialX nodes were read. In this example we look to see if the MayaUSD libraries were loaded by looking for the color correct node: from pxr import Sdr
r = Sdr.Registry()
n = r.GetShaderNodeByIdentifier("LdkND_ColorCorrect_color4")
print(n.GetInputNames()) |
Beta Was this translation helpful? Give feedback.
-
On Windows, you need to open the output window, which can probably be found under the menu bar entry |
Beta Was this translation helpful? Give feedback.
-
@santosd @JGamache-autodesk Not to hijack the discussion, but these continuing issues do add some more weight behind my request to have an option to be able to disable MaterialX and just fall back to a UsdPreviewSurface. 🙏 |
Beta Was this translation helpful? Give feedback.
-
I had a look at the scene itself. The USD viewer application has also issues with the N4 node, which is the normalmap node. usdview gives the following error:
The issue is that this node is fed from:
Which means a color3 output is fed into a vector3 input. Change it to:
To make both USD and MayaUSD happy. As a bonus, Maya will not try to color correct a vector3 image, which might provide better results for your normal map. |
Beta Was this translation helpful? Give feedback.
-
I had a second look at the |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm fairly new to this, so apologies if any of this is obvious, but I have a little problem...
Maya: 2022.4
maya_usd: 0.20.0 Installed from the released Windows binary
Houdini 19.0.720
I have a Houdini LOP that's written out a USD that contains MaterialX shaders and uses a few of the Houdini-specific nodes that ship with Houdini - namely huniformramp.mtlx and hinvlinear.mtlx. If you load this into Maya 2022.4 with maya_usd-0.20.0 as installed from the Windows binary, it opens fine but immediately crashes if you turn Textures on in the viewport. If you open it in Maya 2022.4 with the standard maya_usd-0.13.0, it loads OK and shows a simply usdPreviewSurface. These Houdini-sourced materialx definitions seem to just contain standard materialx nodes (including
ifgreatereq
which I understand is somewhat new, but was introduced before the MaterialX-1.38 that ships with maya_usd-0.20.0).If I add these handful of Houdini-specific material definitions to Maya's MaterialX library (as set in the mayaUsd.mod file) in maya_usd-0.20.0, it no longer crashes but nor does it display anything all that useful - just a grey shader. There are also quite a few errors in the Output window that make me think not everything is quite hunky dory. When it's first loaded, I get...
// Error: Failed verification: ' nodeDef ' -- Could not find MaterialX NodeDef for Node 'NG_Maya/N4'. Please recheck library paths. // // Error: Failed verification: ' nodeDef ' -- Could not find MaterialX NodeDef for Node 'NG_Maya/N4'. Please recheck library paths. // // Error: Caught exception 'Could not find a nodedef for node 'N4'' while processing '/Proxy_vegGrasses_USD_layer_asset_v033Shape_000001DF3222A7F0/vegGrasses/mat/leafGreenCMAT' //
I'm not sure how to work out what NG_Maya/N4 is defined as - I assume it represents a NodeGraph, and I assume it's a name given during a translation process, but as far as I can tell the required node definitions for this material are all where they should be, but this can't be the case or I'd not be getting the error!
In addition to that, If I select the material from the USD Stage in the Outliner, I get...
`# Error: Failed verification: ' item ' #
Error: file: C:/Program Files/Autodesk/Maya2022/scripts/others/showEditor.mel line 3703:RuntimeError: file C:\local_pipe\rez\cache\maya_usd\0.20.0-a\24fa\a\mayausd\MayaUSD3\lib\python\ufe_ae\usd\nodes\usdschemabase\ae_template.py line 338: Invalid attributes object # `
Line 338 of
ae_template.py
appears to relate to attribute connections (and, indeed, these connections appear valid and visible if the USD is loaded in maya_usd-0.13.0).If I drill down into the material's shaders, the aforementioned Houdini-specific nodes appear to show their inputs all correctly, but the NodeGraph that they're contained within doesn't show any attributes (and I get a similar error to above) - where as in maya_usd-0.13.0, this node displays two attributes with connections to the shaders within.
I suspect these issues all have a common cause, namely not being able to find a required node definition. This is causing it to not show correctly in the viewport, not create the attribute connections and ultimately not work properly.
Does anyone know if I'm doing anything obviously wrong, or if they've experienced this before? Or, perhaps more helpfully (in a 'teach a man to fish' way), does anyone know how I might find out exactly what NG_Maya/N4 is so that I can hopefully answer this for myself?!
(And as an aside, I was getting quite a few complaints in the Output window about not being able to find an RGB color with the name 'lead' or 'polymeshDormant' - simply adding these using Maya command
displayRGBColor
makes the error go away, but it could be a relevant diagnostic symptom, as my fairly uneducated glance at the code seems to suggest that prior to 2023, Maya should fall back to supplying a preset value defined in the C++ rather than just wigging out like this?)Thanks and sorry for rambling!
Edit: I just saw I'm not alone in experiencing this, though the feature request here is intended as a way around the issue rather than an actual fix:
#2637
Beta Was this translation helpful? Give feedback.
All reactions