collector

Module Contents

Classes

HoudiniSessionCollector

Collector that operates on the current houdini session. Should inherit from

Functions

_iter_output_nodes()

Iterate over all output nodes in the scene.

HookBaseClass[source]
_HOUDINI_OUTPUTS[source]
class HoudiniSessionCollector[source]

Bases: HookBaseClass

Collector that operates on the current houdini session. Should inherit from the basic collector hook.

_get_icon_path(self, icon_name, icons_folders=None)[source]
collect_current_houdini_session(self, settings, parent_item)[source]

Creates an item that represents the current houdini session.

Parameters
  • settings (dict) – Configured settings for this collector

  • parent_item – Parent Item instance

Returns

Item of type houdini.session

collect_node_outputs(self, settings, parent_item)[source]

Creates items for known output nodes

Parameters
  • settings (dict) – Configured settings for this collector

  • parent_item – Parent Item instance

property common_file_info(self)[source]

Get a mapping of file types information.

Sets up/stores it as self._common_file_info if not initialised.

Returns

File types information

Return type

dict[str, dict[str]]

process_current_session(self, settings, parent_item)[source]

Analyzes the current Houdini session and parents a subtree of items under the parent_item passed in.

Parameters
  • settings (dict) – Configured settings for this collector

  • parent_item – Root item instance

property settings(self)[source]

Dictionary defining the settings that this collector expects to receive through the settings parameter in the process_current_session and process_file methods.

A dictionary on the following form:

{
    "Settings Name": {
        "type": "settings_type",
        "default": "default_value",
        "description": "One line description of the setting"
}

The type string should be one of the data types that toolkit accepts as part of its environment configuration.

_iter_output_nodes()[source]

Iterate over all output nodes in the scene.

For a more functional programming approach, you can try:

for category, type_names in _HOUDINI_OUTPUTS.items():
    node_types = (hou.nodeType(category, name) for name in type_names)
    for node_type in filter(None, node_types):  # Strip None node_type
        yield category, node_type, node_type.instances() or ()
Returns

Node category, node type and all node instances.

Return type

Generator[hou.NodeTypeCategory, hou.NodeType, tuple[hou.Node]]