Hi. Woudl anyone know how to export materialX subnets out as a Material X shader?
Best
Mark
Exporting out as MaterialX
4873 11 3- Mark Wallman
- Member
- 697 posts
- Joined: Aug. 2013
- Offline
- jsmack
- Member
- 8041 posts
- Joined: Sept. 2011
- Online
- rafal
- Staff
- 1454 posts
- Joined: July 2005
- Offline
There is a `vop2mtlx.py` script that exports a VOP HDA as a Material X shader. This is how we generate ramp .mtlx from the HDAs.
There is also `saveShaderNetwork()` function in there, that can save .mtlx from VOP nodes rather than HDA. But it can only handle one-level of subnet, since currently MaterialX does not officially support nested compound node graphs. Compound node graph is one that does not specify shader node definition (nodedef).
There is also `saveShaderNetwork()` function in there, that can save .mtlx from VOP nodes rather than HDA. But it can only handle one-level of subnet, since currently MaterialX does not officially support nested compound node graphs. Compound node graph is one that does not specify shader node definition (nodedef).
- Siavash Tehrani
- Member
- 729 posts
- Joined: July 2005
- Offline
- rafal
- Staff
- 1454 posts
- Joined: July 2005
- Offline
Not necessarily. You should be able to right-click on any VOP node > Save > MaterialX...
This menu item essentially calls
This menu item essentially calls
vop2mtlx.saveShaderNetwork()
, which traverses the input chains. If one of the node in an input chain is a subnet, that subnet will be saved as a node graph. But if that subnet has another subnet inside, it will result in an error, because MaterialX node graph can't have another node graph inside.
- Mark Wallman
- Member
- 697 posts
- Joined: Aug. 2013
- Offline
Hi all. I just came across this which may help...
https://www.youtube.com/watch?v=RpShFmwjMzg [www.youtube.com]
Best. Mark
https://www.youtube.com/watch?v=RpShFmwjMzg [www.youtube.com]
Best. Mark
- StefanA
- Member
- 56 posts
- Joined: Oct. 2019
- Offline
rafal
Not necessarily. You should be able to right-click on any VOP node > Save > MaterialX...
This menu item essentially callsvop2mtlx.saveShaderNetwork()
, which traverses the input chains. If one of the node in an input chain is a subnet, that subnet will be saved as a node graph. But if that subnet has another subnet inside, it will result in an error, because MaterialX node graph can't have another node graph inside.
Hello,
I'm testing this right now and I can't for the world in me read the mtlx file back in again. When I test with the built in shader examples it's works (testing standard_surface_chrome.mtlx as example).
But if I create a standard surface and then export that it will not work.
If I copy paste the code from the mtlx file but change the name from "SR_Chrome" to "My_Test"., and also the same for nodename..it will not work.
So is there anything else we can do to make it work?
Testing this on 19.0.561 (linux)
regards
stefan
- rafal
- Staff
- 1454 posts
- Joined: July 2005
- Offline
- azab4d
- Member
- 2 posts
- Joined: April 2022
- Offline
rafal
The terminal node in your VOP network may need to be the "Mtlx Surface Material" VOP. Ie, you need to feed your standard surface to it as an input. Otherwise USD file plugin won't detect which shader to start loading from.
Hello Rafal,
Without Mtlx surface material node it will not write anything to the xml file. but with mtlx surface material node to export from houdini will not write the shader under <nodeGraph> so it will read just the shader when importing it back without any other nodes connected to that shader like mtlxImage or any other nodes. I know clarisse can read the .mtlx file even if it hasn't <nodeGraph>. but houdini can't!
So, what should i do to export correctly a materialX shader from Houdini and read it back in houdini without losing the nodes connected to the main shader?
- jsmack
- Member
- 8041 posts
- Joined: Sept. 2011
- Online
- kaleem
- Member
- 1 posts
- Joined: July 2024
- Offline
Hello,
I have been using solaris USD for a while now
I am facing a issue when I am trying to export the shader in .mtlx,
I have been checking the AMD GPUopen .mtlx and MOEEN SAYED OpenChessSet .mtlx formats are same, but when I try to export the shader from houdini the code looks different, and it works in houdini but not in unreal due to the difference in code
has anyone faced this issue, or can anyone let me know the proper process of exporting the shader as .mtlx and works in unreal with materialX shader (not display or preview shader), I will send the snaps as well if required
Thanks in advance.
I have been using solaris USD for a while now
I am facing a issue when I am trying to export the shader in .mtlx,
I have been checking the AMD GPUopen .mtlx and MOEEN SAYED OpenChessSet .mtlx formats are same, but when I try to export the shader from houdini the code looks different, and it works in houdini but not in unreal due to the difference in code
has anyone faced this issue, or can anyone let me know the proper process of exporting the shader as .mtlx and works in unreal with materialX shader (not display or preview shader), I will send the snaps as well if required
Thanks in advance.
- Hamilton Meathouse
- Member
- 199 posts
- Joined: Nov. 2013
- Offline
Watch this video for info: https://www.youtube.com/watch?v=SATZxxZqBDk [www.youtube.com]
About 12:50 it starts talking about how exporting .mtlx from Houdini gives a different result than expected.
About 12:50 it starts talking about how exporting .mtlx from Houdini gives a different result than expected.
-
- Quick Links