python.tk_houdini.utils.parm_template_wrappers

Module Contents

Classes

Parm

Wrapper class for houdini parameter template instances.

ParmFolder

Wrapper class for houdini folder parameter template instances.

ParmGroup

Wrapper class for houdini parameter template group instances.

Functions

wrap_node_parameter_group(node)

Helper function to convert a node’s parameter group into

class Parm(template, parent=None)[source]

Bases: object

Wrapper class for houdini parameter template instances.

build(self)[source]

Get the template relating to this Parm object.

Return type

hou.ParmTemplate

dumps(self, indent=0)[source]

Dump a string representation of this object for debugging.

Parameters

indent (int) – Size of indenation.

classmethod from_template(cls, template, parent=None)[source]

Method to build a Parm object from a given template.

Parameters
  • template – A hou.ParmTemplate instance.

  • parent (Parm) – The parent object.

Returns

A Parm or ParmFolder instance.

property name(self)[source]

Get the template name.

Return type

str

class ParmFolder(template, parent=None)[source]

Bases: python.tk_houdini.utils.parm_template_wrappers.Parm

Wrapper class for houdini folder parameter template instances.

__iadd__[source]
__contains__(self, name)[source]

Find out if a template is contained in the list, by name:

Parameters

name (str) – The name of the template to check for.

Return type

bool

__iter__(self)[source]

Iterate through the children list.

Return type

Iterator

__len__(self)[source]

Get the number of children.

Return type

int

_child_templates(self)[source]

Get the template hierarchy from the list of children.

Return type

list(hou.ParmTemplate)

_remove_existing_children(self, parm, root)[source]

Removes all child Parm objects from the given Parm that already exist within the node template hierarchy.

Parameters
  • parm (root) – The Parm to check.

  • parm – The highest level Parm object that the given Parm will belong to.

append(self, parm)[source]

Add a template to the child templates list.

Parameters

parm (Parm) – The Parm to add.

append_template(self, template)[source]

Add a template to the child templates list.

Parameters

template (hou.ParmTemplate) – The template to add.

build(self)[source]

Build the template hierarchy for this instance.

Return type

hou.ParmFolderTemplate

property descendents(self)[source]

Get the descendent templates from this object.

Return type

list(Parm)

dumps(self, indent=0)[source]

Dump a string representation of this object for debugging.

Parameters

indent (int) – Size of indenation.

extend(self, parms)[source]

Add multiple templates to the child templates list..

Parameters

parms (list(Parm))) – The list of Parm instances to add.

extend_templates(self, templates)[source]

Add multiple templates to the child templates list..

Parameters

templates (list(hou.ParmTemplate)) – The list of template instances to add.

get(self, template_name)[source]

Get a template from the child list by name of the template.

Parameters

template_name (str) – The name of the template to get.

Return type

A hou.ParmTemplate instance.

get_root(self)[source]

Get the root item this object belongs to.

Returns

The top most parent ParmGroup instance.

index_of_template(self, template_name)[source]

Get the index of the child template from the list of child templates.

Parameters

template_name (str) – The name of the template to find.

Return type

int

insert(self, index, parm)[source]

Insert a template into the child templates list.

Parameters
  • index (int) – The position to add the template.

  • parm (Parm) – The Parm to insert.

insert_template(self, index, template)[source]

Insert a template into the child templates list.

Parameters
  • index (int) – The position to add the template.

  • template (hou.ParmTemplate) – The template to insert.

pop_template(self, index)[source]

Pop a template from the child templates list.

Parameters

index (int) – The index of the child to pop.

Return type

A hou.ParmTemplate instance.

remove_existing(self, parm)[source]

Removes all instances of existing templates in the given Parm that already exist within the hierarchy.

If the Parm itself is a duplicate, then this method retuns None and the item is not added to the overall template.

Parameters

parm (Parm) – The Parm to check.

Returns

A sanitised Parm or NoneType

class ParmGroup(template, parent=None)[source]

Bases: python.tk_houdini.utils.parm_template_wrappers.ParmFolder

Wrapper class for houdini parameter template group instances.

build(self)[source]

Build the template hierarchy for this instance.

Return type

hou.ParmTemplateGroup

property name(self)[source]

Get the template name.

Return type

str

wrap_node_parameter_group(node)[source]

Helper function to convert a node’s parameter group into a ParmGroup instance.

Parameters

node – A hou.Node instance.

Returns

A ParmGroup instance.