rafal

rafal

About Me

Expertise
Not Specified
Location
Not Specified
Website

Connect

Recent Forum Posts

HDA parm menu from script does not make any sense Jan. 18, 2022, 11:01 a.m.

Ordered Menu is essentially an integer parameter, whose value is an index of an item in that menu.

For menus in general (including an ordered menu), the token can be an arbitrary string, eg "foo", which does not have a numerical value. The "Use Token as Value" applies only to items whose token are numerical strings, eg "20". Eg, if your Ordered Menu is ("10", "Ten", "20", "Twenty") and has Use Token as Value toggled on, then parm.eval() will return integer value of 10 or 20, instead of an index 0 or 1.

If your tokens are non-numeric strings and you want want the token of the current menu item, you don't need "Use Token as Value", but rather you can just eval as string: parm.evalAsString().

Note, menus are not restricted only to Ordered Menu parameter. You can also have a menu on an Integer or on a String parameter. Eg, if you want string tokens, perhaps String parm with menu would be more suitable, since you could do parm.eval() and it would return the token value already.

Exporting out as MaterialX Jan. 5, 2022, 2:36 p.m.

Not necessarily. You should be able to right-click on any VOP node > Save > MaterialX...

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.

Houdini authoring or reading in .mtlx files incorrectly? Jan. 5, 2022, 1:48 p.m.

This is a limitation with the Edit Material Network LOP. It uses VOPs where "bsdf" name is reserved for the VEX data type. So the VOP node complains about that. But that should not impact Karma rendering.