On this page

Overview

You can create compositing node (COP) assets that are defined by a Python script instead of a subnetwork of nodes (File ▸ New operator type, click Python type, set Network type to "Compositing"). This example defines a Python SOP that copies its input, creates a Cd (diffuse color) point attribute, and assigns each point a color based on the distance to a position.

Note

This example requires the numpy library.

Open $HFS/houdini/help/files/hom_cookbook/multi_stamp.hip to see the node.

Implementation

  • You can load the pre-made asset from $HFS/houdini/help/files/hom_cookbook/PythonCops.hda

  • Right-click a multistamp node and choose Type properties to open the asset’s type properties window.

  • We created parameters in the Parameters tab, just as we would for a normal asset.

  • The Code tab contains the Python code implementing the node’s logic.

HOM Cookbook