rafal

rafal

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

My Badges

SideFX Staff
Since Jul 2005

Recent Forum Posts

Material Linker -> Copy to Material Library problem. Sept. 11, 2025, 9:17 a.m.

Can't Copy Materials Into Material Library LOP Sept. 10, 2025, 3:52 p.m.

I looked at the project file, and just realized that in materiallibrary1 the node got pasted along with the activation toggle parameters.

Both Material Library and Edit Material Network LOPs use shader translation python scripts to convert VOP nodes to USD shaders. The translator uses the parameter that starts with `__activate__` to control whether it translates the value for the corresponding shader parameter or not.

Since pasted nodes have all the toggles turned of, the translator does not author any values on the USD shaders. Including any values for the texture files, which would explain the lack of pattern in the rendering.

One way to detect it is to look at the Scene Graph Tree and the attribute values. Another way is to to RMB > Save > Flattened Stage... on "assignmaterial2" and "assignmaterial3" LOPs, save the a.usda and b.usda files and diff them.

To fix the .hip file, you can turn on all the toggles:
>>> def activateParms(node):
...     for parm in node.parms():
...         if parm.name().startswith('__activate__'):
...             parm.set(True)


>>> def activateParms(node):
...     for parm in node.parms():
...         if parm.name().startswith('__activate__'):
...             parm.set(True)
... 
>>> n = hou.node('/stage/materiallibrary1/Carbon_biColor_Coat')
>>> activateParms(n)
>>> 
>>> for child in n.allSubChildren(recurse_in_locked_nodes=False):
...     activateParms(child)
...
>>>

Probably a better approach would be to process the nodes and instead of turning the toggles to remove these activation parameters altogether (along with the "shader_shaderprimname" parameter). That would be done with setParmTemplateGroup() [www.sidefx.com] function.


Note, after the above Python commands to turn on the toggles, I still had to bypass-unbypass the "materiallibrary1" node to clear Karma shader cache and actually get the correct rendering.

Material Linker -> Copy to Material Library problem. Sept. 9, 2025, 11 a.m.

Could you post a simplified .hip file? Something that shows a very simple original material (with just a couple of shader nodes), then the Edit Material Network with a simple change in it, and the pasted nodes in a new Material Library LOP. It would be the best way for me to track it down.