Houdini 20.5 Nodes TOP nodes

Python Virtual Environment TOP node

Creates a Python virtual environment using TOPs

On this page
Since 20.0

This node lets you create tasks that initialize a Python virtual environment and install packages in the environment. You can choose the version of Python to use for the environment, and specify the list of required packages as a string, dictionary or file on disk.

TOP Attributes

requirements

string

When requirementstype is 2 or 3, this attribute contains a string representation of the required packages and package versions.

requirementshfs

string

The list of Houdini Python modules to copy, if Houdini Modules is enabled.

requirementshfsroot

string

The path to the HFS directory to Houdini’s Python modules from, if Houdini Modules is enabled.

requirementspath

string

When requirementstype is 1, this attribute is set to the path to the requirements.txt file with packages to install in the venv.

requirementstype

int

The enum value that determines how package requirements should be installed

venvroot

string

The path on disk to the virtual environment

Parameters

Virtual Environment

Generate When

Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.

All Upstream Items are Generated

This node will generate work items once all of the input nodes have generated their work items.

All Upstream Items are Cooked

This node will generate work items once all of the input nodes have cooked their work items.

Each Upstream Item is Cooked

This node will generate work items each time a work item in an input node is cooked.

Automatic

The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.

Cache Mode

Determines how the processor node handles work items that report expected file results.

Automatic

If the expected result file exists on disk, the work item is marked as cooked without being scheduled. If the file does not exist on disk, the work item is scheduled as normal. If upstream work item dependencies write out new files during a cook, the cache files on work items in this node will also be marked as out-of-date.

Automatic (Ignore Upstream)

The same as Automatic, except upstream file writes do not invalidate cache files on work items in this node and this node will only check output files for its own work items.

Read Files

If the expected result file exists on disk, the work item is marked as cooked without being scheduled. Otherwise the work item is marked as failed.

Write Files

Work items are always scheduled and the expected result file is ignored even if it exists on disk.

Environment Path

The path to the virtual environment on disk.

Python Bin

Determines which Python executable to use when creating the virtual environment and installing packages. This is also the version of Python that will be associated with the venv.

Custom Python Bin

When Python Bin is set to Custom, this parameter determines the path to the Python interpreter to use when creating the virtual environment.

Load Packages From

Determines how PDG should determine the list of packages that should be installed in the virtual environment.

File Source

When Load Packages From is set to Requirements File, this parameter determines how the file is specified.

File Tag

When loading requirements from a file with File Source set to Upstream Output File, this parameter specifies the file tag of the input requirements file.

Custom File

When loading requirements from a file with File Source set to Custom File, this parameter determines the path to the requirements file.

Package List

If Load Packages From is set to Package List, this parameter can be set to a space or comma separated list of packages to install the virtual environment.

Packages

If Load Packages From is set to Package Dictionary, this parameter can be set to a series of key/value pairs representing the name and version of the packages to install.

Houdini Modules

A comma-separated list of Python module folders from Houdini’s Python path, i.e. $HHP, that should be copied into the virtual environment.

Add Environment Path to Output Files

When this parameter is enabled, the virtual environment path is added as an output file to the work item(s) generated by this node. This parameter is required in order for work items to cook from cache – if the venv path exists, then the work item will be treated as cached and won’t cook at all.

Schedulers

TOP Scheduler Override

This parameter overrides the TOP scheduler for this node.

Schedule When

When enabled, this parameter can be used to specify an expression that determines which work items from the node should be scheduled. If the expression returns zero for a given work item, that work item will immediately be marked as cooked instead of being queued with a scheduler. If the expression returns a non-zero value, the work item is scheduled normally.

Work Item Label

Determines how the node should label its work items. This parameter allows you to assign non-unique label strings to your work items which are then used to identify the work items in the attribute panel, task bar, and scheduler job names.

Use Default Label

The work items in this node will use the default label from the TOP network, or have no label if the default is unset.

Inherit From Upstream Item

The work items inherit their labels from their parent work items.

Custom Expression

The work item label is set to the Label Expression custom expression which is evaluated for each item.

Node Defines Label

The work item label is defined in the node’s internal logic.

Label Expression

When on, this parameter specifies a custom label for work items created by this node. The parameter can be an expression that includes references to work item attributes or built-in properties. For example, $OS: @pdg_frame will set the label of each work item based on its frame value.

Work Item Priority

This parameter determines how the current scheduler prioritizes the work items in this node.

Inherit From Upstream Item

The work items inherit their priority from their parent items. If a work item has no parent, its priority is set to 0.

Custom Expression

The work item priority is set to the value of Priority Expression.

Node Defines Priority

The work item priority is set based on the node’s own internal priority calculations.

This option is only available on the Python Processor TOP, ROP Fetch TOP, and ROP Output TOP nodes. These nodes define their own prioritization schemes that are implemented in their node logic.

Priority Expression

This parameter specifies an expression for work item priority. The expression is evaluated for each work item in the node.

This parameter is only available when Work Item Priority is set to Custom Expression.

See also

TOP nodes