Houdini 22.0 Executing tasks with PDG/TOPs

Common how-tos

Quick instructions for working with parameters, expressions, files, and geometry in PDG..

How to

Parameters and Expressions

To...Do this

Reference an attribute in a parameter

  1. Select a work item that has an attribute.

  2. Locate its parameter expression.

  3. Use the @ operator. For example @wedgenum or @size.

Access attributes at a custom index

  • For most indexes, use the@ operator. For example @position.x, @color.g or @array.10.

  • If you need to compute the index using another expression, it may be easier to use pdgattrib(..) function. For example pdgattrib("array", @index*10).

Access input files in a parameter

  • Use @pdg_input or use the pdginput(..) expression function to access input files to the current work item.

Uniquely identify a work item in an expression

  • Use the @pdg_id or @pdg_name instrinsics.

    • Work item IDs are unique in the current Houdini session, and the work item’s name is set to its node name combined with its ID.

Check if PDG is evaluating in the current context

  • Use the ispdgeval() expression function.

    • This is useful if you want to check the current paramete evaluation is happening as part of a PDG cook. For example, to change a switch based on whether or not PDG cook is active.

Files

To...Do this

Find specific file types

  1. Create a File Pattern TOP node.

  2. In the Pattern parameter, set your specific file type. For example $HIP/images/*.png.

    • You can use these wor items as inputs to other nodes that operate on files.

Copy files

  1. Create a File Copy TOP node.

    • Use this node together with a File Pattern TOP that creates attributes like @directory, @filename and @ext. These can be used to construct the new file path. FOr example @directory/@filename.copy.@ext.

Create a text file

  1. Create a Text Output TOP node.

  2. In the Text parameter box, enter your desired text.

    • These can include backtick expressions to access attribute data. For example @size, @color.r, @color.g, and @color.b.

Delete temporary files

PDG writes out temporary files to disk when scheduling tasks

  1. On your scheduler node, and select Delete Temporary Directory.

Geometry

To...Do this

Save geometry to disk

Method 1:

  1. Create a Geometry Import TOP node.

  2. Change the Geometry Source parameter to determine where to load the geometry from. This allows you to load geometry from a SOP in the current scene and write it back out to a file.

Method 2:

  1. Use a ROP Geometry Output TOP node to create tasks that cook a SOP network eith4er on a current machine or a render farm.

Method 3:

  1. Use a HDA Processor TOP node to evaluate a SOP HDA and save the resulting geometry to a file on disk.

Import geometry attributes into PDG

  1. Use a Geometry Import TOP to import geometry attribrutes from a SOP or a geometry file and convert them to work item attributes.

Executing tasks with PDG/TOPs

Basics

Beginner Tutorials

Next steps

  • Running external programs

    How to wrap external functionality in a TOP node.

  • File tags

    Work items track the results created by their work. Each result is tagged with a type.

  • PDG Path Map

    The PDG Path Map manages the mapping of paths between file systems.

  • Feedback loops

    You can use for-each blocks to process looping, sequential chains of operations on work items.

  • Service Blocks

    Services blocks let you define a section of work items that should run using a shared Service process

  • PDG Services

    PDG services manages pools of persistent Houdini sessions that can be used to reduce work item cooking time.

  • Integrating PDG with render farm schedulers

    How to use different schedulers to schedule and execute work.

  • Visualizing work item performance

    How to visualize the relative cook times (or file output sizes) of work items in the network.

  • Event handling

    You can register a Python function to handle events from a PDG node or graph

  • Tips and tricks

    Useful general information and best practices for working with TOPs.

  • Troubleshooting PDG scheduler issues on the farm

    Useful information to help you troubleshoot scheduling PDG work items on the farm.

  • PilotPDG

    Standalone application or limited license for working with PDG-specific workflows.

Reference

  • All TOPs nodes

    TOP nodes define a workflow where data is fed into the network, turned into work items and manipulated by different nodes. Many nodes represent external processes that can be run on the local machine or a server farm.

  • Processor Node Callbacks

    Processor nodes generate work items that can be executed by a scheduler

  • Partitioner Node Callbacks

    Partitioner nodes group multiple upstream work items into single partitions.

  • Scheduler Node Callbacks

    Scheduler nodes execute work items

  • Custom File Tags and Handlers

    PDG uses file tags to determine the type of an output file.

  • Python API

    The classes and functions in the Python pdg package for working with dependency graphs.

  • Job API

    Python API used by job scripts.

  • Utility API

    The classes and functions in the Python pdgutils package are intended for use both in PDG nodes and scripts as well as out-of-process job scripts.