hou.ParmTemplate class

All Methods Replaces

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 exec or execfile functions.

function_name

If 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 value

Not documented yet

defaultValue(self)

Not implemented yet

disableWhen(self)str

Not documented yet

help(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) → string

Not documented yet

look(self) → hou.parmLook enum value

Not documented yet

mayContainExpressions(self)

Not implemented yet

name(self) → string

Not documented yet

namingScheme(self) → hou.parmNamingScheme enum value

Not documented yet

numComponents(self) → int

Not documented yet

setDisableWhen(self, disable_when)

Not documented yet

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)

Not documented yet

setTags(self, tags)

Not documented yet

tags(self) -> dict of string to string

Not documented yet

type(self) → hou.parmTemplateType enum value

Not documented yet

Replaces

opscript command