Houdini 19.5 Nodes Dynamics nodes

Gas OpenCL Merge VDB dynamics node

Uses OpenCL to import VDB data from source geometry into simulation fields.

On this page
Since 19.0

Gas OpenCL Merge VDB node imports VDB data into DOP fields. Its functionality is very similar to the volume sourcing features of the Volume Source DOP (when Source Type is set to Individual Volumes) and Volume Instance Source DOP (when Source Type is set to Packed Sets). The main difference is that the Gas OpenCL Merge VDB node leverages NanoVDB to perform the merging operations in OpenCL.

Note

If the object has an attached position data, this DOP will respect its translation.

Note

This node only applies the sources within their active regions. This is equivalent to having the Clamped parameter enabled on the Volume Source DOP.

Parameters

Source Type

Controls the mode of operation for this DOP.

Individual Volumes

This option merges individual VDBs from Geometry using the specified Operations.

Packed Sets

In this mode, packed source sets from Geometry are instanced and sourced using instance points in Instance Geometry. Operations are hidden in this mode, since the sourcing rules are expected to be present on the instance points. You can use Pyro Spawn Sources and Pyro Source Instance operators to easily generate these instance points.

Geometry

Name of the geometry data on the simulation object containing the source VDBs.

Source Name Suffix

This string will be appended at the end of each Volume to construct the effective name of the source VDB.

Instance Geometry

If Source Type is set to Individual Volumes and this is enabled, all source VDBs will be instanced at every point of the specified geometry data. P (position), orient (unit quaternion for orientation), and pivot (pivot location for rotations) point attributes on the instance geometry affect the placement of each instance.

If Source Type is set to Packed Sets, this geometry must contain instance points for the packed sets. In addition to the placement attributes listed above, each instance point must have a name attribute to identify its source set along with a source_rules dictionary array that contains the merging operations. An optional frame_offset attribute signals the frame offset within the respective packed source set.

Position

The source VDBs will be spatially offset by this vector before merging with the destination field.

Operations

The number of volume merging operations to perform. These operations are only available when Source Type is set to Individual Volumes. If Source Type is Packed Sets, then the merging operations are read from point attributes of the instance points instead.

Rank

Rank of the target field.

Volume

Base name of the VDB to merge. This string will be combined with Source Name Suffix to construct the full name of the source VDB.

Weight

Base name of the VDB containing the weights for Volume, when Operation is set to Blend. This string will be combined with Source Name Suffix to construct the full name of the weight VDB.

Field

The DOP field that is to be modified.

Weight

Name of the weight field for the destination; applicable only when the Operation is set to Blend.

Operation

The merging operation.

Copy

Values in the target Field will be overwritten by those in the source Volume.

Add

Result is the sum of values in Field and Volume.

Subtract

Result is the difference between values in Field and Volume; the difference can optionally be clamped against zero by enabling Avoid Negatives.

Multiply

Result is the product of values in Field and Volume.

Divide

Values in the Field will be divided by the corresponding values in the Volume.

Maximum

Result is the larger of the values in Field and Volume. For vector fields, comparison can be performed length-wise by enabling Use Vector Length.

Minimum

Result is the smaller of the values in Field and Volume. For vector fields, comparison can be performed length-wise by enabling Use Vector Length.

Average

Result is the average of values in Field and Volume.

Pull

Values in the Field are pushed towards the corresponding entries in Source Volume, in accordance to settings of Acceleration Strength, Deceleration Strength, and Direction Strength.

Blend

Result stored in the Field is (s * v + d * w) / (v + w), where s, v, d, w represent values of the source, source weight, target field, and target weight, respectively. Additionally, the values of source weight are added to the target weight field.

None

Field is left untouched.

Use Vector Length

With vector fields, when Operation is set to Maximum or Minimum, this option can be enabled to signal that comparisons are to be done using lengths of the vectors, rather than component-wise.

Avoid Negatives

When Operation is set to Subtract and this option is enabled, negative results will be changed to zero.

Acceleration Strength

Controls how strongly the Field's values are pushed towards the source Volume. Applies for the voxels in which the Volume has larger values than the target Field.

Deceleration Strength

Controls how strongly the Field's values are pushed towards the source Volume. Applies for the voxels in which the Volume has smaller values than the target Field.

Direction Strength

When enabled, controls how strongly the Field's vectors are pushed to align with source Volume's. This option can only be used with vector fields. When disabled for vector fields, guiding is performed independently for each component of the target Field.

Note

Acceleration Strength and Deceleration Strength apply to the vector lengths when this option is enabled.

Scale

A multiplier applied to the source values before merging.

Use Timestep

Normalizes the Scale against the timestep and the canonical frame rate of 24. This ensures that sourcing is performed to the same real extent, regardless of the simulation timescale.

For example, with the default frame rate of 24, normalization causes the Scale to be used as is for every frame. If frame rate is increased to 48, effective scale will be halved per frame, resulting in the same amount of additive sourcing.

Locals

channelname

This DOP node defines a local variable for each channel and parameter on the Data Options page, with the same name as the channel. So for example, the node may have channels for Position (positionx, positiony, positionz) and a parameter for an object name (objectname).

Then there will also be local variables with the names positionx, positiony, positionz, and objectname. These variables will evaluate to the previous value for that parameter.

This previous value is always stored as part of the data attached to the object being processed. This is essentially a shortcut for a dopfield expression like:

dopfield($DOPNET, $OBJID, dataName, "Options", 0, channelname)

If the data does not already exist, then a value of zero or an empty string will be returned.

DATACT

This value is the simulation time (see variable ST) at which the current data was created. This value may not be the same as the current simulation time if this node is modifying existing data, rather than creating new data.

DATACF

This value is the simulation frame (see variable SF) at which the current data was created. This value may not be the same as the current simulation frame if this node is modifying existing data, rather than creating new data.

RELNAME

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to the name of the relationship to which the data is being attached.

RELOBJIDS

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the object identifiers for all the Affected Objects of the relationship to which the data is being attached.

RELOBJNAMES

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the names of all the Affected Objects of the relationship to which the data is being attached.

RELAFFOBJIDS

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the object identifiers for all the Affector Objects of the relationship to which the data is being attached.

RELAFFOBJNAMES

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the names of all the Affector Objects of the relationship to which the data is being attached.

ST

This value is the simulation time for which the node is being evaluated.

This value may not be equal to the current Houdini time represented by the variable T, depending on the settings of the DOP Network Offset Time and Time Scale parameters.

This value is guaranteed to have a value of zero at the start of a simulation, so when testing for the first timestep of a simulation, it is best to use a test like $ST == 0 rather than $T == 0 or $FF == 1.

SF

This value is the simulation frame (or more accurately, the simulation time step number) for which the node is being evaluated.

This value may not be equal to the current Houdini frame number represented by the variable F, depending on the settings of the DOP Network parameters. Instead, this value is equal to the simulation time (ST) divided by the simulation timestep size (TIMESTEP).

TIMESTEP

This value is the size of a simulation timestep. This value is useful to scale values that are expressed in units per second, but are applied on each timestep.

SFPS

This value is the inverse of the TIMESTEP value. It is the number of timesteps per second of simulation time.

SNOBJ

This is the number of objects in the simulation. For nodes that create objects such as the Empty Object node, this value will increase for each object that is evaluated.

A good way to guarantee unique object names is to use an expression like object_$SNOBJ.

NOBJ

This value is the number of objects that will be evaluated by the current node during this timestep. This value will often be different from SNOBJ, as many nodes do not process all the objects in a simulation.

This value may return 0 if the node does not process each object sequentially (such as the Group DOP).

OBJ

This value is the index of the specific object being processed by the node. This value will always run from zero to NOBJ-1 in a given timestep. This value does not identify the current object within the simulation like OBJID or OBJNAME, just the object’s position in the current order of processing.

This value is useful for generating a random number for each object, or simply splitting the objects into two or more groups to be processed in different ways. This value will be -1 if the node does not process objects sequentially (such as the Group DOP).

OBJID

This is the unique object identifier for the object being processed. Every object is assigned an integer value that is unique among all objects in the simulation for all time. Even if an object is deleted, its identifier is never reused.

The object identifier can always be used to uniquely identify a given object. This makes this variable very useful in situations where each object needs to be treated differently. It can be used to produce a unique random number for each object, for example.

This value is also the best way to look up information on an object using the dopfield expression function. This value will be -1 if the node does not process objects sequentially (such as the Group DOP).

ALLOBJIDS

This string contains a space separated list of the unique object identifiers for every object being processed by the current node.

ALLOBJNAMES

This string contains a space separated list of the names of every object being processed by the current node.

OBJCT

This value is the simulation time (see variable ST) at which the current object was created.

Therefore, to check if an object was created on the current timestep, the expression $ST == $OBJCT should always be used. This value will be zero if the node does not process objects sequentially (such as the Group DOP).

OBJCF

This value is the simulation frame (see variable SF) at which the current object was created.

This value is equivalent to using the dopsttoframe expression on the OBJCT variable. This value will be zero if the node does not process objects sequentially (such as the Group DOP).

OBJNAME

This is a string value containing the name of the object being processed.

Object names are not guaranteed to be unique within a simulation. However, if you name your objects carefully so that they are unique, the object name can be a much easier way to identify an object than the unique object identifier, OBJID.

The object name can also be used to treat a number of similar objects (with the same name) as a virtual group. If there are 20 objects named “myobject”, specifying strcmp($OBJNAME, "myobject") == 0 in the activation field of a DOP will cause that DOP to operate only on those 20 objects. This value will be the empty string if the node does not process objects sequentially (such as the Group DOP).

DOPNET

This is a string value containing the full path of the current DOP Network. This value is most useful in DOP subnet digital assets where you want to know the path to the DOP Network that contains the node.

Note

Most dynamics nodes have local variables with the same names as the node’s parameters. For example, in a Position node, you could write the expression:

$tx + 0.1

…to make the object move 0.1 units along the X axis at each timestep.

See also

Dynamics nodes