Found 9 posts.
Search results Show results as topic list.
Solaris and Karma » Scaling MaterialX Procedural Patterns
- spencer_luebbert
- 9 posts
- Offline
I think the right idea is to ship higher level convivence mtlx nodes that are built out of standard mtlx nodes, not mtlx HDAs. That would keep things cross compatible.
Solaris and Karma » How to extend the MaterialX standard library?
- spencer_luebbert
- 9 posts
- Offline
I'm able to use custom mtlx VEX nodes and preview their output in Karma after running mtlx2HDA.py and mtlx2Karma.py (see this thread [www.sidefx.com])
But when I go to export a mtlx file from the vex graph (right click node -> Save -> MaterialX) I get a python error that it cannot find my custom node def.
If I manually drop my mtlx files that include the node def into the standard houdini library (C:\Program Files\Side Effects Software\Houdini 19.0.589\houdini\materialx) they will export as expected.
We'd rather pull in the node def mtlx files from a user package, so that we don't have to modify the houdini install directory.
We have a folder that gets pulled in as a user package (added to the houdini_path in C:\Users\<user>\Documents\houdini19.0\packages\myPackage.json) Houdini will automatically find a subfolder called "materialX" inside of our package folder, and it adds it to the environment variable MATERIALX_SEARCH_PATH, I confirmed this by running hou.getenv('MATERIALX_SEARCH_PATH') in the python console after Houdini starts up. If I understand how materialx is supposed to work, this SHOULD be enough to let houdini's materialx implementation find our node def mtlx files.
Does Houdini support using the MATERIALX_SEARCH_PATH for extending the standard library?
But when I go to export a mtlx file from the vex graph (right click node -> Save -> MaterialX) I get a python error that it cannot find my custom node def.
If I manually drop my mtlx files that include the node def into the standard houdini library (C:\Program Files\Side Effects Software\Houdini 19.0.589\houdini\materialx) they will export as expected.
We'd rather pull in the node def mtlx files from a user package, so that we don't have to modify the houdini install directory.
We have a folder that gets pulled in as a user package (added to the houdini_path in C:\Users\<user>\Documents\houdini19.0\packages\myPackage.json) Houdini will automatically find a subfolder called "materialX" inside of our package folder, and it adds it to the environment variable MATERIALX_SEARCH_PATH, I confirmed this by running hou.getenv('MATERIALX_SEARCH_PATH') in the python console after Houdini starts up. If I understand how materialx is supposed to work, this SHOULD be enough to let houdini's materialx implementation find our node def mtlx files.
Does Houdini support using the MATERIALX_SEARCH_PATH for extending the standard library?
Edited by spencer_luebbert - 2022年5月13日 12:17:16
Solaris and Karma » mtlx2hda.py | How do I use it?
- spencer_luebbert
- 9 posts
- Offline
I got an answer in the ASWF slack. If you run mtlx2karma.py after mtlx2hda.py it will generate the karma shaders for the new HDAs. This is necessary because Karma does not use MaterialX's code generation, it implements each standard node directly.
Solaris and Karma » mtlx2hda.py | How do I use it?
- spencer_luebbert
- 9 posts
- Offline
I have a custom surface shader, defined in myCustomSurface.mtlx, I was able to use mtlx2hda.py to create the vex nodes.
I can drop these nodes into the vex graph, they appear to make valid materialx because I an right-click > Save on the node and export a .mtlx file.
It does not look like they are supported at all in the viewport (karma or GL). I tried putting myCustomSurface.mtlx inside of C:\Program Files\Side Effects Software\Houdini 19.0.589\houdini\materialx\libraries\bxdf thinking that maybe Houdini just need the mtlx source, but that didn't make a difference.
Are custom nodes created from mtlx2hda.py meant to be supported in karma or GL renderer?
I can drop these nodes into the vex graph, they appear to make valid materialx because I an right-click > Save on the node and export a .mtlx file.
It does not look like they are supported at all in the viewport (karma or GL). I tried putting myCustomSurface.mtlx inside of C:\Program Files\Side Effects Software\Houdini 19.0.589\houdini\materialx\libraries\bxdf thinking that maybe Houdini just need the mtlx source, but that didn't make a difference.
Are custom nodes created from mtlx2hda.py meant to be supported in karma or GL renderer?
Technical Discussion » LOPs custom shader to be used in external renderer.
- spencer_luebbert
- 9 posts
- Offline
Rafal, this is super helpful, thanks!
Is this documented anywhere? Being a new user I'm often wondering if I've stumbled onto some undocumented features of Houdini, or if I just don't know where to look.
Is this documented anywhere? Being a new user I'm often wondering if I've stumbled onto some undocumented features of Houdini, or if I just don't know where to look.
Technical Discussion » LOPs custom shader to be used in external renderer.
- spencer_luebbert
- 9 posts
- Offline
Thanks for pointing that out! I was able to piece together what to do after reading through the python documentation.
The following worked for me:
NOTE! The Shader Name property inside of the GenericShader node is parsed by the translator to determine the shader source type. So if your shader has a source asset (like mySurface.osl), put that file path in the Shader Name property! Similary, if you leave that name blank, it will use the existing USD.
The following worked for me:
- Upstream of the Material Library LOP, make sure the custom usd material exsists on the stage
- Inside the Material Library LOP place a Specialize USD Material node and pick your custom USD shader. Now you can hook up textures like you would to the regular USDPreviewSurface.
- Then collect at the end to include both shaders
NOTE! The Shader Name property inside of the GenericShader node is parsed by the translator to determine the shader source type. So if your shader has a source asset (like mySurface.osl), put that file path in the Shader Name property! Similary, if you leave that name blank, it will use the existing USD.
Technical Discussion » LOPs custom shader to be used in external renderer.
- spencer_luebbert
- 9 posts
- Offline
Technical Discussion » LOPs custom shader to be used in external renderer.
- spencer_luebbert
- 9 posts
- Offline
Hello! I'm a relatively new user to Houdini, and trying work out the best way to include a new custom USD shader for an external renderer. Is there a standard way to do this?
It seems like the VEX Generic Shader node or Material Builder nodes get me part way there, but so far I haven't been able to put together all the pieces.
My backup plan is to modify the USD with another LOP node after the Principled Shader is added by a Material Library operator. This just feels non-standard, but maybe this is the best way to do it.
How far off am I here? Any feedback is appreciated.
Thanks!
It seems like the VEX Generic Shader node or Material Builder nodes get me part way there, but so far I haven't been able to put together all the pieces.
My backup plan is to modify the USD with another LOP node after the Principled Shader is added by a Material Library operator. This just feels non-standard, but maybe this is the best way to do it.
How far off am I here? Any feedback is appreciated.
Thanks!
Houdini Indie and Apprentice » Quick Python: callback script fom button parm ?
- spencer_luebbert
- 9 posts
- Offline
I had this exact same problem, and the fix was to use the 'PythonModule' name.
I think what got me was that I renamed the module in the scripts tab late in the day, Houdini must have kept a reference to the function around when it was previously named PythonModule because it worked for hours with the new module name. The next day I re-open Houdini and nothing is working.
So, a friendly reminder to always restart and test before calling something done!
Also thanks for posting the fix! This was like the 3rd or 4th post I've found asking about this error, but the only one that posted a solution.
I think what got me was that I renamed the module in the scripts tab late in the day, Houdini must have kept a reference to the function around when it was previously named PythonModule because it worked for hours with the new module name. The next day I re-open Houdini and nothing is working.
So, a friendly reminder to always restart and test before calling something done!
Also thanks for posting the fix! This was like the 3rd or 4th post I've found asking about this error, but the only one that posted a solution.
-
- Quick Links