Skip to content

Instantly share code, notes, and snippets.

@csprance
Created December 19, 2019 14:31
Show Gist options
  • Save csprance/bfe17a9d0767ce69427706f9ece4a0dd to your computer and use it in GitHub Desktop.
Save csprance/bfe17a9d0767ce69427706f9ece4a0dd to your computer and use it in GitHub Desktop.
Houdini - How to set multiparm defaults.
lod_presets = [100, 50, 25, 12, 6]
def set_hda_defaults(hda):
hda.parm("lod_levels").set(5)
# if we have a classname detail attrib use that
class_name = hda.geometry(0).findGlobalAttrib("classname")
if class_name:
hda.parm("sopoutput").set("$HIP/`chs('./base_name')`.fbx")
hda.parm("base_name").set(class_name.strings()[0])
else:
hda.parm("base_name").set(hda.inputConnections()[0].inputNode().name())
for x in range(5):
hda.parm("reduction_amt%s" % (x + 1)).set(lod_presets[x])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment