hou.ParmTemplate
class
Subclasses: hou.FloatParmTemplate , hou.SeparatorParmTemplate , hou.FolderSetParmTemplate , hou.ButtonParmTemplate , hou.LabelParmTemplate , hou.IntParmTemplate , hou.StringParmTemplate , hou.ToggleParmTemplate , hou.RampParmTemplate , hou.MultiParmTemplate , hou.MenuParmTemplate
Methods
asCode(self, function_name=None)→str-
Returns a script of Python statements that can be executed to recreate the parameter template. To run the script, use either Python’s
execorexecfilefunctions.function_nameIf function_name is specified, then the output script is wrapped in a Python function definition with the given name. function_name must be a non-zero length string consisting of only alphanumeric and underscore characters. Any invalid characters are internally converted to underscores.
The function returns a reference to the newly created parameter template object.
Here is an example of saving the output to a file and then loading it back into Houdini:
# Get a reference to the target parameter template. node = hou.node("/obj/geo1") pt = node.parm("tx").parmTemplate() # Execute asCode and write the output script to file. script = pt.asCode() f = open("create_parm_template.py", "w") f.write(script) f.close() # Execute the script. The new parameter template will be stored # in the 'hou_parm_template' variable. execfile("create_parm_template.py") # Add a spare parameter to the node using the saved parameter # template. node.addSpareParmTuple(hou_parm_template)
Here is an example of saving the output into a function and then calling it in Houdini:
# Get a reference to the target parameter template. node = hou.node("/obj/geo1") pt = node.parm("tx").parmTemplate() # Execute asCode and write the function definition to file. func = pt.asCode(function_name="createParmTemplate") f = open("parmTemplateLib.py", "w") f.write(func) f.close() # Call the function definition. import parmtemplatelib hou_parm_template = parmtemplatelib.createParmTemplate() # Add a spare parameter to the node using the saved parameter # template. node.addSpareParmTuple(hou_parm_template)
dataType(self)→ hou.parmData enum valuedefaultValue(self)disableWhen(self)→strhelp(self)→str-
Returns the help that Houdini displays when you hover over the parameter label in the parameter pane.
hide(self, on)-
Marks this parameter as visible or invisible in the parameter pane.
Note that hidden parameters still exist, and can be evaluated, channel-referenced, etc. They simply will not be displayed in the parameter pane.
isHidden(self)→bool-
Returns whether this parameter is hidden in the parameter pane.
joinWithNext(self)→bool-
Returns whether this parameter is displayed on the same line as the next parameter in the parameter pane.
label(self)→ stringlook(self)→ hou.parmLook enum valuemayContainExpressions(self)name(self)→ stringnamingScheme(self)→ hou.parmNamingScheme enum valuenumComponents(self)→ intsetDisableWhen(self, disable_when)setHelp(self, help)-
Set the help that Houdini displays when you hover over the parameter label in the parameter pane.
setJoinWithNext(self, on)-
Sets whether this parameter is displayed on the same line as the next parameter in the parameter pane.
setName(self, name)setTags(self, tags)type(self)→ hou.parmTemplateType enum value