Houdini 12 Nodes Dynamics nodes

Attaches the appropriate data for Cloth Objects to an object.

The Cloth Configure Object DOP takes a simulation object and attaches the data which is needed for it to be used as a cloth object.

This DOP is very similar to the Cloth Object DOP, except it allows you to explicitly control the creation of the object using another DOP, such as the Empty Object DOP. This can be used for more advanced instancing or creating objects every 10 frames.

Cloth Forces

Cloth’s movement is governed by internal forces. These forces are derived from stretch, shear and bend energies:

Stretch

The stretch energy depends on the deviation of a cloth edge’s length from the rest length. The higher the Stretch Stiffness parameter is set, the stronger the internal force resulting from stretch energies will be.

Shear

The shear energy depends on the deformation of a cloth polygon compared to its rest state. The higher the Shear Stiffness parameter, the stronger the forces that try to restore the cloth polygons to their original shapes.

Bend

The more two adjacent polygons are bent, relative to the rest state, the stronger are the forces that try to push the cloth back.

The stiffness parameters (Stretch Stiffness, Shear Stiffness, and Bend Stiffness) control the strengths of the forces that counteract cloth deformations. Stretch Stiffness determines the magnitude of the forces that aim to restore the cloth’s edges to their rest lengths. Shear Stiffness determines how strongly the cloth will counteract changes in the shape of the cloth polygons. Bend Stiffness controls the strength of the internal forces that try to bend the cloth back to its rest angles. The corresponding damping parameters (Stretch Damping, Shear Damping, and Bend Damping) control how fast these forces will reduce in magnitude, bringing the cloth to a stable state.

Stiffness and damping parameters can be used to control the elastic behavior of cloth. If only these parameters are specified, then the rest state of the cloth will remain the same over time, and the cloth’s internal forces will be based on the deviations of stretch, shear, and bend from their corresponding rest states.

Bend Model determines how the amount of bending between adjacent polygons is translated into internal cloth forces. The Weak bend model bases the bend forces on linear springs. This bend model is the most appropriate choice for simulating cloth fabric materials. The Strong bend model generates forces based on the angle between adjacent polygons, using angular springs. This model is more suitable for modeling rubber balls, or semi-rigid objects. Generally, the Strong bend model will allow the cloth to regain its original shape. This is not always the case for the Weak bend model.

Tip

To make the cloth appear rigid part way through the simulation, animate the Stiffness and Damping parameters.

Along with elastic deformation, it is also possible to simulate plastic deformation of cloth. This feature allows the cloth’s rest state to be changed over time.

If the Enable Tearing option on the cloth solver is activated, then the cloth solver will look at the Tear Thresholds for stretch, shear, and bend to determine which polygons will be torn apart at each frame. For example, if the stretch threshold is set at a value of 0.1, then the cloth solver will try to tear any cloth edges that have been stretched more than 10% compared with the rest length. The shear and bend thresholds work analogously.

Cloth-External Collisions

Cloth-Cloth Collisions and Self Collisions

Houdini does its best to ensure that two pieces of cloth never pass through each other, or that a single piece of cloth never passes through itself. To do this, the initial position of the cloth object(s) must be collision-free.

Cloth-cloth and cloth-self collisions are detected between points, polylines, and closed polygons in the cloth’s simulation geometry. Houdini’s cloth solver uses swept collision detection. At substeps between frames, the positions of the geometry are interpolated linearly from frame to frame. This ensures that collisions are never missed when parts of the cloth move fast and that no tunneling occurs.

Attributes

You can create attributes on the cloth geometry (specified in SOP Path). Most of these attributes are multipliers for the global per-object values that are specified by parameters of the cloth object.

The cloth solver will recognize and use attributes on the simulated cloth geometry. In the DOP network, this simulation geometry is attached to the Cloth 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 position and velocity attributes p and v.

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

Name Class Type Description
P Point Vector Current position of each cloth point.
v Point Vector Current velocity of each cloth point.
a Point Vector Current acceleration of each cloth point.
j Point Vector Current jerk of each cloth point.

The initialpid attribute is used to remember the initial point number of each point when the point numbers change due to tearing or topology changes made by a SOP solver. When processing SBD constraints, the solver will look up the constrained point and the goal point by initialpid rather than the point index.

initialpid Class Type initial point index for each simulation point.

The fexternal and pintoanimation attributes can be used to influence the simulation. The pintoanimation attribute will take the animated positions and velocities from the Animation Geometry. The id point attribute is used to match points in the simulation geometry with points in the Animation Geometry. This makes animation work even if there are topology changes in the simulation geometry.

Name Class Type Description
fexternal Point Vector External force applied to each point.
pintoanimation Point Float Animates each point that has value > 0.5

These point attributes work as multipliers for the parameters in the Material tab:

Name Class Type Description
sedgestretchstiffness sshearstiffness sweakbendstiffness sstrongbendstiffness Point Float Multipliers for the stiffness parameters.
sedgestretchdamping ssheardamping sweakbenddamping sstrongbenddamping Point Float Multipliers for the damping parameters.
surfacemassdensity Point Float Multiplier for the object’s Surface Mass Density

The following attributes are multipliers for the global per-object values that are specified by parameters of the cloth object.

Name Class Type Description
thickness Point Float Multiplier for the object’s Thickness.
friction Point Float Multiplier for the object’s Friction.
repulsion Point Float Multiplier for the object’s Repulsion.
animation stiffness Point Float Multiplier for the object’s Animation Stiffness.
animation damping Point Float Multiplier for the object’s Animation Geometry.
normal drag Point Float Multiplier for the object’s Normal Drag.
tangent drag Point Float Multiplier for the object’s Tangent Drag.

The following point attribute enables/disables the possibility of tearing for each cloth point

Name Class Type Description
enabletearing Point Float

When less than 0.5, this point cannot be torn.

Parameters

Creation Frame Specifies Simulation Frame

Determines if the creation frame refers to global Houdini frames ($F) or to simulation specific frames ($SF). The latter is affected by the offset time and scale time at the DOP network level.

Creation Frame

The frame number on which the object will be created. The object is created only when the current frame number is equal to this parameter value. This means the DOP Network must evaluate a timestep at the specified frame, or the object will not be created.

For example, if this value is set to 3.5, the Timestep parameter of the DOP Network must be changed to 1/(2*$FPS) to ensure the DOP Network has a timestep at frame 3.5.

Number of Objects

Instead of making a single object, you can create a number of identical objects. You can set each object’s parameters individually by using the $OBJID expression.

Object Name

The name for the created object. This is the name that shows up in the details view and is used to reference this particular object externally.

Note

While it is possible to have many objects with the same name, this complicates writing references, so it is recommended to use something like $OBJID in the name.

Solve On Creation Frame

For the newly created objects, this parameter controls whether or not the solver for that object should solve for the object on the timestep in which it was created.

Usually this parameter will be turned on if this node is creating objects in the middle of a simulation rather than creating objects for the initial state of the simulation.

Allow Caching

By preventing a large object from being cached, you can ensure there is enough room in the cache for the previous frames of its collision geometry.

This option should only be set when you are working with a very large sim. It is much better just to use a larger memory cache if possible.

Initial Geometry

The path to a SOP that contains the point positions and velocities which are used to initialize the simulation geometry of a cloth object.

The cloth solver does not require the geometry to be triangulated. It is usually best to have simulation geometry that consists almost entirely of quads, with some triangles to connect patches of quads. Non-planar quads are not a problem for the solver.

Triangulation is not recommended because it may result in slower simulations and it will introduce a triangulation bias in your simulation results. The solver works best when the quads in the geometry are roughly square shaped, and of similar size.

Note

Triangles and quads with very small area or with very small edges should be avoided at all costs.

Rest Geometry

This determines the rest positions for the cloth points. If Enable Plastic Deformation is not set on the solver, the cloth will always try to approach the shape specified by the Rest Geometry. For each simulation point, the corresponding rest point is found by matching the id point attribute. This point attribute is created automatically by the cloth object if the user doesn’t create it explicitly.

When the solver has Support Changing Rest State turned on, the rest state is allowed to change over time.

If the solver has Enable Plastic Deformation turned on, the Rest Geometry is read only at the object’s creation time. From then on, the rest state of the cloth is determined by the effects of the plastic deformation.

Animation Geometry

This determines the animated positions for the cloth points. Each cloth point on the simulation geometry that has the point-attribute pintoanimation set to 1 will exactly follow the position and velocity of the corresponding point in the Animation Geometry. For each simulation point, the corresponding animation point is found by matching the id point attribute. This point attribute is created automatically by the cloth object if the user doesn’t create it explicitly.

The positions and velocities from the Animation Geometry can also be used to generate forces that will blend in some of the animation with the simulation.

Use Object Transform

The transform of the object containing the chosen SOP is applied to the geometry.

Initial State

This defines a transform that is applied to the point positions in the SOP Geometry at the creation time (and only at that time). This transform does not affect the Rest Geometry or the Animation Geometry.

Position

Initial position in world space of the object.

Rotation

Initial orientation of the object. This is in RX/RY/RZ format.

Pivot

Local space position around which rotation is applied.

Material

Stiffness

The stiffness parameters define how strongly the cloth initially resists stretching/shearing/bending. The effect of stiffness is independent of the amount of detail in your cloth.

The defaults for cloth stiffness work the best if you model the cloth to real size. If you don’t model your cloth 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 Spatial Scale is 1 (overriding the initial estimate that the Cloth Object shelf tool may have made).

Each of the stiffness parameters assigns a uniform stiffness over the entire object. If you want to make parts of the object weaker or stronger, then use can locally multiply the stiffness using the point attributes

sedgestretchstiffness sshearstiffness sweakbendstiffness sstrongbendstiffness.

sedgestretchdamping ssheardamping sweakbenddamping sstrongbenddamping.

Collisions

Cloth-External Collisions

If enabled, then polygons in the cloth object will collide with polygons of non-cloth objects in the simulation, such as Static Objects, RBD Objects, or the Ground Plane. Only polygons in the non-cloth objects will be considered for collisions. Other types of primitives, for example spheres, will be ignored.

Cloth-Cloth Collisions

When enabled, polygons of this cloth object will collide with polygons on other cloth objects.

Self Collisions

If enabled, polygons that belong on the same cloth object will collide with each other. This prevents cloth from penetrating itself.

Cloth Thickness

The cloth thickness parameter creates an imaginary film around the cloth object. This film consists of all points that have a distance of at most Cloth Thickness to some cloth polygon. The cloth solver tries to ensure that the films for the cloth objects don’t penetrate each other or pass through each other.

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

When a cloth object collides with a non-cloth object, then only the cloth object will have a film applied to it (the polygons in the non-cloth object will be treated as having thickness zero).

The Cloth Thickness parameter is one of the few cloth parameters that is scale dependent. Adjust this parameter when you change the scale or amount of detail of your geometry.

Use a thickness that is significantly smaller than the smallest edge in your geometry. Typically, the thickness should be approximately 1% percent of the average edge length. To avoid problems with cloth self collisions, keep the polygons 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.

Contact Repulsion

A repulsion force is applied to gently push apart these pieces of geometry when the thickness layers of two pieces of geometry that are in contact overlap. This parameter controls the strength the force.

Animation

Animation Stiffness

This parameter determines how quickly the simulated cloth will adapt its position to the positions in the Animation Geometry. The higher this value is, the more aggressively the cloth will try to match the animated positions. To get smooth looking results you will need to set Animation Damping as well.

Animation Damping

This determines how quickly the simulated cloth will adapt its velocity to the velocities in the Animation Geometry. The higher this value is, the more aggressively the cloth will try to match the animated velocities. Setting this value high enough will prevent the simulated cloth from moving around the animated cloth in a springy or jittery way.

Drag

The drag parameters express how fast the cloth will adapt its velocity to the velocity of the surrounding air, such as wind.

Tangent Drag

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

Normal Drag

The direction normal to the cloth polygons. Increasing this will make the cloth go along with any wind that blows against it. For realistic cloth-wind interaction, the Normal Drag should be chosen larger (about 10 times larger) than the tangent drag.

Tip

An easy way to set a wind speed is by using the External Velocity Offset.

External Velocity Field

The name of the external velocity fields on affectors that the cloth will respond to. The default is vel, which will make the cloth 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 cloth’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

Thickness

Visualize the cloth’s thickness.

Thickness Color

Color of the cloth thickness guide geometry.

Penetration

Highlight where the cloth surface is penetrating another object or itself. This requires Thickness to be on.

Penetration Color

Color of the penetration highlights.

Velocity

Visualize per-point velocities.

Velocity Scale

Scale of the lines showing per-point velocity when Velocity is on. Try increasing this if your turn on Velocity but the lines are not visible.

Velocity Color

Color of per-point velocity lines when Velocity is on.

Inputs

First

The simulation objects to turn into cloth objects by attaching the appropriate data.

Outputs

First

The simulation objects which were passed into this node are output with the data required for them to be considered cloth Objects attached.

Local variables

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.

Examples that use this node

Example forExample name
Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/AnimatedClothPatch.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/BendCloth.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/BendDamping.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/BlanketBall.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/ClothAttachedDynamic.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/ClothFriction.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/Denting.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/DragCloth.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/PinnedClothWind.otl

Cloth SolverLoad | Launch

.../examples/nodes/dop/clothsolver/SphereClothCollision.otl

Fan ForceLoad | Launch

.../examples/nodes/dop/fan/SimpleFan.otl

Particle Fluid SolverLoad | Launch

.../examples/nodes/dop/particlefluidsolver/ParticlesAndCloth.otl

Switch SolverLoad | Launch

.../examples/nodes/dop/switchsolver/SimpleSwitch.otl

Cloth DeformLoad | Launch

.../examples/nodes/sop/clothdeform/CaptureDeform.otl