Houdini 20.0 Nodes Dynamics nodes

Cloth Object 1.0 dynamics node

Creates a Cloth Object from SOP Geometry.

On this page

The Cloth Object DOP creates a Cloth Object inside the DOP simulation. It creates a new object and attaches the subdata required for it to be a properly conforming Cloth Object. Cloth objects can be simulated using the FEM Solver.

You can use any polygonal geometry in SOPs to create your cloth object. Your cloth geometry should satisfy guidelines that ensure a fast-running and good looking simulation.

See cloth forces and cloth collisions for more information.

Using Cloth Object

  1. Select the object to make into a cloth object.

  2. Click the Cloth Object tool from the Cloth tab.

Parameters

Model

Overall Stiffness

This determines how strongly the cloth object resists deformation. The Overall Stiffness is independent of the resolution of the mesh. If the materialuv attribute is used to specify cloth UV coordinates are specified on the mesh, then the effect of stiffness is also independent of the orientations of the triangles and quads in the mesh. The default setting for the Overall Stiffness works the best if you model the simulation geometry to real size. If you don’t model your geometry in meters, then make sure that you set the correct units of length in the Hip File Options. This should be done before you create your DOP network. When using real-size models, you should make sure that you have your length units set correctly before you create your DOP network: You should set the correct Unit Length in Edit > Preferences > Hip File Options before you create your DOP network.

Overall Damping Ratio

This value should lie between 0 and 1. The Overall Damping Ratio controls the rate of energy loss as a result of the rate of deformation. A value of 0 means that there is no loss of energy due to internal damping forces. A value of 1 means that the object is critically damped, in which case the object comes to rest in the quickest possible way without oscillating. The higher the damping ratio, the less the cloth oscillates and the quicker the object’s motion will come to rest. The effect of damping is independent of your geometry’s resolution.

Surface Mass Density

This is the mass per square meter. The mass density can be made lower or higher in parts of the object using the primitive attribute surfacemassdensity, which works as a multiplier for the parameter.

Relative Stiffness

These values should lie between 0 and 1 and act as modifiers to the Overall Stiffness for specific types of deformation. The Relative Stiffness parameters determine the relative strengths of the internal forces that counteract planar shape changes and bending. Together, the Relative Stiffness contributions for stretch and shear determine the resistance against changes within the local cloth surface plane. The contribution for Weak Bend and Strong Bend determine how strongly the object resists bending. The Weak Bend model can be used to create thin silky kinds of cloth sheets. The Strong Bend model can be used to create a strong resistance against bending, for example, for leather or thick rubber. The effect of Relative Stiffness is independent of the amount of detail and the shapes of the triangles and quadrangles your simulation geometry.

The stretch and shear contributions of Relative Stiffness work in the directions of the cloth material UV’s. These UV coordinates can be specified by the materialuv vertex or point attribute. When no UV coordinates are specified, the material directions are determined by the polygon edges. The Visualization tab of the Cloth Object has an option that allows you to see which UV directions are being currently used by the cloth object.

Relative Damping Ratio

These values should lie between 0 and 1 and act as modifiers to the Overall Damping Ratio. The Relative Damping Ratio parameters allow you to determine separately how much energy loss is introduced by the rate of changes in planar shape (stretch + shear) and the rate of bending.

Anisotropic Strength

These values allow you to very the strength of the internal stress within the cloth surface separately for the U and V directions. The U and V directions can be provided using the vertex and point attributes materialuv. For example, to make the cloth more stretchy in the U direction than in the V direction, you could set a lower value (say 0.5) for the U component of the Anisotropic Strength while keeping the V component unchanged.

Seam Angle

This is the rest angle along edges between two primitives that belong to separate panels. Panels are connected by pinning together two cloth objects using a stitch constraint or by specifying separate per-vertex rest positions within a single cloth object. The seam angle does not affect the rest angle for polygons that lie within a single panel. If you want to make parts of the object have different rest angles, then you can locally multiply the rest angle using the primitive attribute seamangle.

Geometry

Initial Geometry

This geometry determines the initial simulated state of the object. It determines the initial position and velocity for each of the points.

This is the geometry that is used for the computation of internal forces and for collision detection. Your cloth geometry should satisfy guidelines that ensure a fast-running and good looking simulation.

In many cases, you can use the Remesh SOP to help you create a suitable simulation mesh. When using triangulated geometry, it is recommended that you provide a materialuv point or vertex attribute to specify the directions of the cloth fabric.

Import Target Geometry

This option allows you to specify and animate the target positions that are used by the simulation inside the SOP network (without having to use a SOP solver). The option defines whether the target positions should be imported from a SOP geometry node at each frame. When enabled, the solver will copy target positions from the point attribute targetP of the SOP geometry node onto the attribute targetP on the simulation geometry at each frame. If no targetP exists, then the P attribute from the SOP geometry node is copied instead.

Target Geometry Path

The path to the SOP node that will serve as the source of the target positions. The positions should be stored in an attribute with the name targetP. If this attribute is not found, the P attribute is used as a fallback.

Stiffness

This coefficient determines how strongly the finite element solver tries to make the point positions match the target point positions. The solver creates an imaginary potential force for this purpose.

Damping

This coefficient determines how strongly the finite element solver tries to make the point velocities match the target point velocities. The solver creates an imaginary dissipation force for this purpose.

Collisions

Collide with objects

If enabled, the geometry in this object will collide with all other objects. These other objects may belong to the same solver or they may be be Static Objects, RBD Objects, or the Ground Plane. When the Collision Detection parameter on the Static Object is set to Use Volume Collisions, then the polygon vertices will be tested for collision against the signed distance field (SDF) of the Static Object. When Collision Detection is set to Use Surface Collisions, then geometry-based continuous collision detection is used. The geometry-based collisions collide points against polygons, and edges against edges.

When geometry-based collisions are used, only polygons and tetrahedrons in the Static Object are considered. Other types of primitives, for example spheres, are be ignored. The geometry of the external objects (e.g. Static Object) is treated as being one-sided; only the outsides of the polygons, determined by the winding order, oppose collisions.

When volume-based collisions are enabled, only points will be colliding against the volumes, not the interiors of polygons and tetrahedrons. When colliding against small volumes, this may mean that you need to increase the number of points on your mesh to get accurate collision results.

Collide with objects in this solver

When enabled, this object will collide with other objects that have the same solver. These collisions are handled using continuous collision detection, based on the geometry (polygons and/or tetrahedrons). For collisions between objects on the same solver, the polygons are treated as two-sided. Both sides of the polygons collide. The surface of a tetrahedral mesh only collides on one side: the outside.

Collide within this object

If disabled, then no two polygons within this object can collide with each other.

Collide within each component

If disabled, then no two polygons that belong on the same connected component may collide with each other.

Collide within each fracture part

This option only has an effect when fracturing is enabled on the solver. If disabled, then no two polygons that belong on the same fracture part may collide with each other. Fracture parts are controlled by the integer-valued fracturepart primitive attribute.

Collision Radius

This is the radius of an imaginary padding layer around the polygons. This layer consists of the region of space that has a distance of at most Collision Radius to some polygon. For two-sided collision surfaces, such as cloth geometry, the layer applies to both sides of each polygon (back and front). For one-sided collision surfaces, such as polygons in a Static Object, the collision radius is applied only on the front side of the polygons. The FEM Solver tries to ensure that the layers for the objects don’t penetrate each other or pass through each other.

For example, when a pair of two-sided polygons collide, one with a thickness of 0.01 and one with a thickness of 0.02, the solver will try to separate polygons of these objects by a distance of 0.03.

The Thickness parameter is one of the very few parameters that is scale dependent. It is very important that you adjust this parameter when you change the scale or amount of detail of your geometry.

Use a Thickness that is significantly smaller than the length of the shortest edge in your simulation geometry. Typically, the Thickness should not exceed 1% percent of the average edge length. To avoid problems with self collisions, you should keep the polygons (and/or tetrahedrons) in your geometry fairly even-sized. Avoid polygons that have very small edges, compared to the average size of the polygons in your cloth geometry.

Friction

The coefficient of friction of the object. A value of 0 means the object is frictionless. This governs how much the velocity that is tangential to the contact plane is affected by collisions. When two objects are in contact, then the solver multiplies the friction coefficients of the involved object to get the effective friction coefficient for that contact.

Drag

Normal Drag

The component of drag in the directions normal to the surface. Increasing this will make the object go along with any wind that blows against it. For realistic wind interaction, the Normal Drag should be chosen larger (about 10 times larger) than the tangent drag.

Tangent Drag

The component of drag in the direction tangent to the surface. Increasing this will make the object go along with any wind that blows tangent to the object.

External Velocity Field

The name of the external velocity fields on affectors that the object will respond to. The default is vel, which will make the object react to fluids and smoke when the Tangent Drag and the Normal Drag have been chosen sufficiently large. The Tangent Drag and Normal Drag forces are computed by comparing the object’s velocity with the external velocity.

External Velocity Offset

This offset is added to any velocity that’s read from the velocity field. When there’s no velocity field, then the offset can be used to create a wind force which has constant velocity everywhere. This wind effect is more realistic and more accurate than the wind that is generated by DOP Forces.

Visualization

Collision Radius

Visualize the cloth’s collisionradius.

Collision Radius Color

Color of the cloth collisionradius guide geometry.

Attributes

The finite element solver will recognize and use attributes on the simulated geometry. In the DOP network, this simulation geometry is attached to the simulated object as a sim-data with name Geometry. When an object is created, then the geometry and all the corresponding attributes are read from the Initial Geometry. This includes the standard position and velocity point attributes P and v.

The finite element solve supports input attributes and output attributes. Some attributes, such as the simulation state, are both input and output attributes. The input attributes include multiplier attributes for material properties, fracture attributes, and attributes for controlling target positions and corresponding hard/soft constraints. The output attributes include optional attributes for tet quality, energy densities, FEM node forces, collision info attributes and fracture info attributes.

Material Property Multiplier Attributes

Each of the material properties of a simulated object can be locally modified using multiplier point attributes. As a rule, each of the material properties in the Model tab of an object can be affected by a multiplier attribute. As a rule, the name of the parameter is the name of the attribute. The name of the attribute is the name that is displayed after “Parameter:” when you hover over a parameter with your mouse cursor.

You can locally change the material properties of the object using point attributes. For example, you can make some polygons resists stretching and bending more than other polygons. These attributes work as multipliers for the parameters in the Model tab: The stiffness multiplier is a convenient way to modify the local stiffness for all object types that are recognized by the finite element solver:

Name Class Type Description
stiffness Point Float Multiplier for all types of stiffness.
dampingratio Point Float Multiplier for all damping ratios.
massdensity Point Float Multiplier for all mass densities.

For solid objects, the following multiplier point attributes can be used to modify the local behavior:

Name Class Type Description
solidstiffness Point Float Multiplier for both the shape stiffness and the volume stiffness of a Solid Object.
solidshapestiffness Point Float Multiplier for the shape stiffness of a Solid Object.
solidvolumestiffness Point Float Multiplier for the volume stiffness of a Solid Object.
solidmassdensity Point Float Multiplier for the mass density of a Solid Object.

Collision Control Attributes

The FEM solver looks at collision identifiers to decide which primitive pairs are allowed to collide. The rule is that a pair of primitives may collide if they have the same collision identifier. (This mechanism may possibly be extended in a future release, allowing the user to specify exactly which collision identifier pairs may collide.) Collisions can be suppressed altogether for certain primitives by setting the special value -1. A collision id may be specified separately for the interior and the exterior side of each polygon and tetrahedron. The exterior side of a polygon is decided using the winding order convention, just like the normal direction. If interiorcollisionid is not specified, then the default collision id of 0 is used for triangles, but interior collisions are disabled for tets. If exteriorcollisionid is not specified, then the default collision id of 0 is used for both tets and triangles.

Consider, as an example, an FEM muscle simulation, we may want the muscles to collide only with the interior side of the skin polygons, so the exteriorcollisionid for those polygons may be set to -1 (disable).

Name Class Type Description
exteriorcollisionid Primitive Integer Collision identifier for the exterior side of a polygon or tet surface
interiorcollisionid Primitive Integer Collision identifier for the interior side of a polygon or tet surface

The following attributes can be used to locally multiply the Repulsion and Friction parameters:

Name Class Type Description
repulsion Primitive Float Multiplier for the Repulsion of an FEM Object
friction Primitive Float Multiplier for the Friction of an FEM Object

Material Space Attributes

The attribute materialP can be thought of as the positions of the simulated object in the material space. materialP is the undeformed configuration relative to which the current position P determines the deformation of a simulated object. materialP must stay the same throughout the entire simulation. The finite element solver relies on assumption that the materialP attribute remains unchanged from frame to frame; it should never be modified externally (e.g., through a SOP solver) otherwise bad simulation results will be produced.

In the case where no Rest Shape is specified and nor restP attribute is provided, materialP can be thought of as a permanent rest position. If no animation of the rest position is required in a sim, only materialP should be specified (no restP). At any stage in the simulation, it is the mapping from materialP to the current P that determines the deformation of tets in simulated objects. The deformation in turn defines the energy stored inside the object.

To help determine the anisotropic behavior of solids, including fiber contraction, the solver can makes use of local UVW frames. These UVW frames may be specified directly using the vertex/point attributes materialU, materialV, and materialW. Alternatively, they may be inferred from UVW positions that may be specified by a vertex/point position attribute materialuvw. The FEM solver embeds the UVW directions within the material space that may be specified by the attribute materialP. To get the correct idea of how this works, UVW directions that are fed into the FEM solver should be visualized relative to the material position materialP.

For FEM muscle simulations, the easiest way to specify the muscle fiber direction is through vertex/point attribute materialW. It is fine if no materialU and materialV directions are specified in this case, as the solver will infer arbitrary materialU and materialV directions from materialW in that case.

The attribute materialuvw can be used to specify a UVW parametrization of the material space. The U, V and W directions that are implied by materialuvw matter if the anisotropic controls are used or when the fiber controls are used on a simulated object. For the FEM muscle simulation use case, the fiber controls are an important tool for controlling muscle contraction.

Similar to materialuvw, the materialuv attribute can be used to specify UV directions for cloth. This attribute is essential for triangle meshes, in particular, to define the warped and weft directions for cloth.

Name Class Type Description
materialP Point or Vertex Vector Material position of each point, defining the material space
materialU Point or Vertex Vector The U direction within the material space
materialV Point or Vertex Vector The V direction within the material space
materialW Point or Vertex Vector The W direction within the material space
materialuvw Point or Vertex Vector Local material uvw coordinates for each point or vertex of a tet.
materialuv Point or Vertex Vector Local material uvw coordinates for each point or vertex of a polygon or polysoup.

Material Property Multiplier Attributes

fracturepart Primitive Integer Partitions the object into unbreakable parts. Must be either -1 (no part) or a nonnegative number that indicates a part.
enablefracturing Point/Vertex Integer Locally enable/disable fracturing for points or vertices.
fracturethreshold Point/Vertex Float Multiplier for the object’s Fracture Threshold.

Fracturing Control Attributes

When you create a simulation with fracturing, it is recommended to specify chunks of tetrahedrons that you want to stay together. Otherwise, the fracturing process may create a very large amount of separate pieces, many of which may consist of single tetrahedrons. For this purpose, you can assign a nonnegative integer to each chunk using the fracturepart attribute. In areas where you don’t want to specify parts, you can set fracturepart to -1, which means that each primitive in that region will become its own part. Real-life materials tend not to be equally strong everywhere. For realistic results, it is recommended to vary the Fracture Threshold locally using the vertex attribute fracturethreshold.

fracturepart Primitive Integer Partitions the object into unbreakable parts. Must be either -1 (no part) or a nonnegative number that indicates a part.
enablefracturing Point/Vertex Integer Locally enable/disable fracturing for points or vertices.
fracturethreshold Point/Vertex Float Multiplier for the object’s Fracture Threshold.

Drag Force Control Attributes

The behavior of the drag force can be modified locally using the following attributes:

normaldrag Primitive Float Multiplier for the object’s Normal Drag.
tangentdrag Primitive Float Multiplier for the object’s Tangent Drag.

Reference Attributes

The attribute baseP can be used to specify a generic base position for all the object points. This attribute’s values must not be changed during a simulation. When the user does not specify baseP, the solver creates this point attribute based on the point positions on the creation frame. This attribute is used as a fallback; whenever the user does not specify materialP, the attribute baseP is read instead. In the same way, baseP is used as a fallback for when no restP or targetP attributes are provided. Finally, baseP is used to bind the simulated and the embedded geometry, in the embedded workflow (e.g., a T-pose). This embedded binding looks at the baseP position attribute on both the simulated geometry and the embedded geometry. If no baseP attribute is provided by the user on the embedded geometry, the solver creates the baseP attribute on the embedded geometry based on the position P at the creation frame.

If Allow Changing Rest is enabled on the FEM Solver, then the attribute restP may be used to modify rest positions. The attribute restP can be used to specify an animated rest position for all the object points. For example, at each frame restP may be modified in a SOP Solver before the finite element solver. Among other things this makes it possible to create plastic deformation kinds of effects. When the rest should stay the same during an entire simulation the attribute restP should not be used. In that case, it is sufficient to specify only an attribute materialP, which would act as a permanent, unchanged rest position. If no attribute materialP is specified, the solver falls back to the baseP attribute that gets automatically created at the creation frame. table>>

Target Attributes

Target attributes can be used to make a simulated object partially follow a target animation. The attribute targetP can be used to specify a target position for each object point. When you use the Import Target Geometry option on the simulated object, the targetP will be set automatically every frame. Alternatively, you can create and modify these attributes yourself, using a Multi Solver and a SOP Solver. The target positions and velocities allow the user to mix animation and simulation in a very stable way (assuming the Target Strength and Target Damping parameters have been set on the object). You can set the Target Strength and Target Damping parameters on the object to express how strongly the object should match the target position and velocity, respectively. This is a way to create soft constraints. You can use the pintoanimation to create hard constraints that make the simulated points follow targetP exactly.

Name Class Type Description
targetP Point or Vertex Vector Target position of each point.
targetstrength Point Float Multiplier for the object’s Target Strength. If this attribute is missing, a multiplier of 1 is used at all points.
targetdamping Point Float Multiplier for the object’s Target Damping. If this attribute is missing, a multiplier of 1 is used at all points.
pintoanimation Point Int When 1, the point is hard constrained to the target animation (e.g., targetP). When zero, the point is unconstrained.

Fiber Attributes

The fiberscale point attribute acts as a multiplier for the rest strain in the fiber direction. The fiber direction itself can be specified using the materialW vertex/point attribute. Among other things, this is useful for FEM muscle simulations. If the fiberscale is changed from 1 to 0.5, then the muscle wants to be half as long as before in the direction of the fiber. If you animate the fiberscale in a SOP Solver such that it decreases from 1 to a smaller value, you will cause a muscle contraction in the sim.

The fiberstiffness point attribute acts as a multiplier for the stiffness along the fiber direction. The fiber direction of the material is determined by the W axis of the materialuvw coordinates. fiberstiffness works as a multiplier on top of all the other material property multipliers, including the anisotropic multipliers. If the fiberstiffness changed from 1 to 10, then the stiffness along the fiber direction becomes 10 stronger than before. This can be used to control how strong and how quick the effect of muscle flexing using the fiberscale attribute takes effect.

For fiberscale/fiberstiffness to have the desired effect, it is important that UVW directions are specified. A material-space UVWs for FEM muscles can be specified using the materialuvw point/vertex attribute. By providing materialuvw as a vertex attribute, you are able to provide a local UVW space for each individual tet, which gives you to option of providing a separate UVW frame to each tet.

Name Class Type Description
fiberstiffness Point Float Multiplier for stiffness along the fiber direction, the W direction implied by materialuvw.
fiberscale Point Float Multiplier for the rest strain along the fiber direction, the W direction implied by materialuvw.

State Attributes

Below is a list of attributes that are maintained internally by the solver. Each of these attributes is written to at the end of each solve and read from at the start of the next solve. You should not modify any of these attributes yourself. When you do, the solver is likely to become unstable and you will get bad results. However, you can inspect the values in these attributes in your network for visualization or for the creation of secondary effects.

At each frame, the finite element solver computes a new physical state for each simulated object. The physical state of the object is represented by the point attributes P and v, representing the position and velocity, respectively. The solver’s integration scheme maintains additional attributes a for acceleration and j for jerk.

The point attributes P, v, a, and j store the current integration state of the object. These attributes should not be modified during the simulation because the finite element solver will become unstable and produce low-quality results.

Name Class Type Description
P Point Vector Do not modify! Current position of each object point.
v Point Vector Do not modify! Current velocity of each object point.
accel Point Vector Do not modify! Current acceleration of each object point.
jerk Point Vector Do not modify! Current jerk of each object point.

Embedded Geometry Attributes

These attributes are created on the Embedded Geometry of the Solid Object. The parent attribute is maintained by the embedding code itself, and should not be modified. The baseP point attribute can be provided on the Embedded Geometry by the user to control the binding between the simulated geometry and the embedded geometry. If no baseP is provided, it will be copied from the point positions stored in P at the creation frame. The alignment happens relative to the baseP point attribute on the simulated geometry. If the simulated geometry has a materialP vertex or point attribute, then this attribute takes precedence, allowing control per vertex, rather than per point, if necessary. When you want to ensure that embedded geometry ends up on the desired side of a fracture between simulated geometry, you can use the combination of vertex attributes baseP on the embedded geometry and restP on the simulated geometry. This allows you to line up the embedded geometry with the separate parts in the simulated geometry, for example using the Exploded View SOP. The fracturepart attribute allows you to make sure that the embedded geometry follows the right parts when it gets fractured. When both the simulated and the embedded geometry have the fracturepart attribute, the finite element solver will parent embedded geometry to simulated geometry that has the same fracture part.

Name Class Type Description
parent Primitive Float The index of a parent primitive in the simulated geometry.
baseP Point Float Base positions used for alignment with simulated mesh.
fracturepart Point or Vertex Float Optional user-specified fracture part ID.
P Point Float Positions that correspond to the deformed state.
v Point Float Velocities that correspond to the deformed state.
N Point or Vertex Float Normals that correspond to the deformed state.

Optional Output Attributes

These are attributes that are optionally generated by the solver, when the generation is enabled on the simulated object. These attributes can be useful for visualization, for example, using the Finite Element Visualization SOP. Additionally, these attributes may be used to create secondary effects, for example, particles flying off in regions where fracturing occurs. The optional output attributes are also expected by the Finite Element Visualization SOP.

The following attribute is generated when Create Quality Attributes is turned on:

Name Class Type Description
quality Primitive Float A quality metric between 0 (worst) and 1 (best)

Finite element simulation tends to be sensitive to the quality of the incoming primitives. Low quality primitives may slow down, destabilize or lock a finite element simulation. Low quality primitives are best avoided by using the Tet Embed as a tool to create your tet mesh. Although various quality metrics exist for tetrahedra, the one that’s generated by the solver in this attribute is the one that best matches Houdini’s finite element solution.

The solver generates energy-density attributes for each object that has Create Energy Attributes turned on. The material property settings in the Model tab and the corresponding multiplier attributes result in potential energy, energy dissipation and kinetic energy. For each of these three contributions, local densities are computed within the solver. These densities and quantities derived from them are used to determine the motion and behavior of the objects that are solved by the finite element solver.

Name Class Type Description
potentialdensity Point Float The local density of deformation energy
dissipationdensity Point Float The local density of the rate of energy loss
kineticdensity Point Float The local density of the kinetic energy

The potentialdensity attribute is directly affected by the stiffness parameters in the Model tab. The kineticdensity is proportional to the mass density that is specified for the object. The dissipationdensity is related to the damping settings.

If Create Fracture Attributes is enabled on the simulated object, then the fracturecount point attribute is created. The point attribute fracturecount maintains for each point, the number of times that the point has been involved in a fracture. So any point with a nonzero value of fracturecount has been involved fracturing.

Name Class Type Description
fracturecount Point Integer The number of times a point was fractured during the simulation

Legacy Attributes

In most situations where you want to influence a finite-element simulation, you will want to use soft constraints to achieve this, for example, target constraints, region constraints, or the target strength/damping settings on the object. These are first-class solver features that work in a stable way with the solver and should produce high quality results when used correctly. Purely for backwards compatibility, a force attribute is still supported. Because the force attribute lacks essential information that the solver needs, this attribute cannot be relied on when stability and quality are important. When setting up a new sim, alternatives such as soft targeting, region constraints and animated rest positions should be considered instead of the force attribute.

Name Class Type Description
fexternal Force Vector External force density
force Force Vector Another name for external force density

Outputs

First

The cloth object created by this node is sent through the single output.

Locals

ST

The simulation time for which the node is being evaluated.

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

ST 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

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

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

TIMESTEP

The size of a simulation timestep. This value is useful for scaling values that are expressed in units per second, but are applied on each timestep.

SFPS

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

SNOBJ

The number of objects in the simulation. For nodes that create objects such as the Empty Object DOP, SNOBJ increases for each object that is evaluated.

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

NOBJ

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

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

OBJ

The index of the specific object being processed by the node. This value always runs from zero to NOBJ-1 in a given timestep. It does not identify the current object within the simulation like OBJID or OBJNAME; it only identifies 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 is -1 if the node does not process objects sequentially (such as the Group DOP).

OBJID

The unique 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. This is very useful in situations where each object needs to be treated differently, for example, to produce a unique random number for each object.

This value is also the best way to look up information on an object using the dopfield expression function.

OBJID is -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

The simulation time (see variable ST) at which the current object was created.

To check if an object was created on the current timestep, the expression $ST == $OBJCT should always be used.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJCF

The simulation frame (see variable SF) at which the current object was created. It is equivalent to using the dopsttoframe expression on the OBJCT variable.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJNAME

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 on only those 20 objects.

This value is the empty string if the node does not process objects sequentially (such as the Group DOP).

DOPNET

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 DOP, 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