Cloth Object
dynamics node
Creates a Cloth Object from SOP Geometry.
See also: Cloth Configure Object, Cloth Physical Parameters, Cloth Material, Cloth Solver
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.
You can use the enabletearing point attribute to define the points in a SOP that may be torn. If the value is higher than 0.5, the cloth is able to be torn, depending on the Tear Threshold.
Using Cloth Object
-
Select the object to make into a cloth object.
-
Click the
Cloth Object tool from the Cloth tab.
Elastic and Plastic Deformation
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 stretchstiffness parameter is set for a cloth object, 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 shearstiffness parameter, the stronger are 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 (stretchstiffness, shearstiffness, and bendstiffness) control the strengths of the forces that counteract cloth deformations. The stretch stiffness determines the magnitude of the forces that aim to restore the cloth’s edges to their rest lengths. The shearstiffness determines how strongly the cloth will counteract changes in the shape of the cloth polygons. The bendstiffness controls the strength of the internal forces that try to bend the cloth back to its rest angles. The corresponding damping parameters (stretchdamping, sheardamping, and benddamping) 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.
The “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 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. 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.
To make the cloth appear rigid part way through the simulation, animate the Stiffness and Damping parameters. Make sure the Support Changing Coefficients option is turned on.
Along with elastic deformation, it is also possible to simulate plastic deformation of cloth. For this you will need to switch on “Enable Plastic Deformation” on the cloth solver. Plastic deformations allow permanent changes to the cloth shape. Plastic deformation is controlled by the elastic limit parameters (stretchelasticlimit, shearelasticlimit, and bendelasticlimit), and the plastic hardening parameters (stretchplastic, shearelasticlimit, and bendelasticlimit). For example, if a cloth edge is stretched more than a fraction of stretchelasticlimit of its original length, then the rest state for the edge will be changed, and the cloth won’t try to regain its original rest state for that edge. The plastic hardening parameters control how the stiffness and damping coefficients for stretch, shear, and bend forces will be affected by plastic deformation. A plastic hardening between 0 and 1 will weaken the cloth (decreasing stiffness and damping), whereas a plastic hardening greater than 1 will strengthen the cloth (increasing stiffness and damping). A hardening of 1 will keep the stiffness unchanged.
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
Collision Geometry Representation
Cloth can collide with and respond to external, non-cloth objects. When it performs collision detection, the cloth solver will look only at the points, polylines, and closed polygons that exist in the geometry of these external objects. All other types of primitives are ignored as far as collisions are concerned. The cloth solver does not use SDFs when it collides with external, non-cloth objects. To achieve a reliable interaction with animated objects, the cloth solver linearly interpolates the positions of the cloth points and the points in the external object’s geometry.
It is not neccessary or efficient to triangulate any geometry before feeding it to the cloth solver. The solver treats all geometry as if it is triangulated.
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. It requires that the initial position of the cloth object(s) be collision-free.
Cloth-cloth and cloth-self collisions are detected between cloth points and cloth polygons. Houdini uses swept collision detection. This ensures that collisions are not missed when parts of the cloth move fast.
Visualization
Visualization requires the Cloth Solver to create energy and/or force information on the cloth geometry during solving. This is enabled using the various Create Attributes parameters on the Cloth Solver DOP. Visualization settings on this DOP can then be used to inspect the cloth behavior after simulation is complete.
Attributes
You can create attributes on the cloth object’s geometry to influence its behavior. Most of these attributes allow fine-tuning of the cloth by scaling (multiplying) default values set in this node.
| Name | Class | Type | Description |
|---|---|---|---|
| v | Point | Vector | Initial velocity of each point. |
| Name | Class | Type | Description |
|---|---|---|---|
| stretchstiffness | Point | Float |
Multiplier for stretchstiffness parameter on cloth object. |
| stretchdamping | Point | Float |
Multiplier for stretchdamping parameter on cloth object. |
| stretchelasticlimit | Point | Float |
Multiplier for stretchelasticlimit parameter on cloth object. |
| stretchplastichardening | Point | Float |
Multiplier for stretchplastichardening parameter on cloth object. |
| shearstiffness | Point | Float |
Multiplier for shearstiffness parameter on cloth object. |
| sheardamping | Point | Float |
Multiplier for sheardamping parameter on cloth object. |
| shearelasticlimit | Point | Float |
Multiplier for shearelasticlimit parameter on cloth object. |
| shearplastichardening | Point | Float |
Multiplier for shearplastichardening parameter on cloth object. |
| bendstiffness | Point | Float |
Multiplier for bendstiffness parameter on cloth object. |
| benddamping | Point | Float |
Multiplier for benddamping parameter on cloth object. |
| bendelasticlimit | Point | Float |
Multiplier for bendelasticlimit parameter on cloth object. |
| bendplastichardening | Point | Float |
Multiplier for dendplastichardening parameter on cloth object. |
Parameters
|
Creation Frame Specifies Simulation Frame |
Determines if the creation frame refers to global Houdini frames ( |
|
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 |
|
Number of Objects |
Instead of making a single object, one can create a number of identical objects. You can set each object’s parameters individually by using the |
|
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 |
|
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. |
|
SOP Path |
The path to a SOP (or an Object, in which case the display SOP is used) which will be the rest geometry for this object. The cloth solver works directly with the polygons in the SOP (the cloth solver won’t apply any triangulations). |
|
Rest Geometry |
This is a path to a SOP that has the rest positions for all the cloth points. |
|
Use Object Transform |
The transform of the object containing the chosen SOP is applied to the geometry. |
Initial State
|
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. |
Physical
|
Compute Mass |
If this toggle is enabled, then the mass for the cloth points is calculated using the density. Otherwise, the total mass for the object equals the mass parameter. |
|
Surface Density |
The mass of a cloth object is its surface area times its density. |
|
Mass |
The total mass for the cloth object. |
|
Contact Damping |
Determines how much energy dissipates in cloth collisions, and reduces velocity components that are orthogonal to the contact surface. It is similar to the friction coefficient, which indicates how much energy is lost by friction. The Contact Damping parameter helps the cloth to come to rest after a collision. |
|
Friction |
The coefficient of friction of the object. A value of 0 means the object is frictionless. This governs how much the tangential velocity is affected by collisions. |
Material
|
Stiffness |
The stretch/shear/bend stiffness parameters define how strongly the cloth initially resists stretching/shearing/bending. The actual values of the cloth stiffness coefficients may change over time as a result of plastic deformation. |
|
Damping |
The higher the damping, the quicker cloth energy dissipates as a result of resisting stretch/shear/bend. The damping parameter determines how quick the internal forces that oppose stretch/shear/bend diminish over time. The actual values of the cloth damping coefficients may change over time as a result of plastic deformation. |
Plastic Flow Threshold: This threshold, which is normalized between 0 and 1,
determines the point at which stretch/shear/bend deformation becomes plastic (non-elastic, irreversible).
For example, in the case of stretch, the Plastic Flow Threshold is the fraction of the original rest length an edge needs to stretch before it starts behaving non-elastically. If the edge stretch stays within the threshold, the edge will be completely elastic, and the rest length won’t be affected.
|
Plastic Flow Rate |
In purely elastic cloth, the rest state is always constant. For example, the rest length of an edge is always the same. The Plastic Flow Rate is the speed at which the rest state adapts itself to the current state. The higher the Plastic Flow Rate, the quicker the cloth will forget its old position. This parameter is normalized. |
|
Plastic Hardening |
This determines how the stretch/shear/bend stiffness and damping are affected when the elastic limit is exceeded. A negative value will make the cloth softer, decreasing the stiffness and damping parameters over time. A positive value will make the cloth harder, increasing the stiffness and damping parameters over time. |
|
Tear Threshold |
The stretch/shear/bend values below which the solver performs tearing. |
Collisions
|
Cloth/Volume Collisions |
If enabled, the cloth object will be prevented from touching or passing through any affectors that have a Volume collider label (e.g., RBD Objects or the ground plane). |
|
Cloth/Cloth Collisions |
If enabled, the cloth object will be prevented from touching or passing through any other cloth objects that affect it. This can make the simulation much slower. |
|
Self Collisions |
If enabled, the cloth object will be prevented from touching or passing through itself. This can make the simulation much slower. |
|
Cloth Thickness |
This parameter only affects cloth collisions, it is not used to compute mass. To prevent cloth objects from becoming entangled, the cloth-cloth collision code pretends that there is an invisible layer that surrounds the cloth geometry. |
Outputs
|
First |
The cloth object created by this node is sent through the single output. |
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 |
|
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 |
|
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 |
|
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 |
|
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. |
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:
$positionx + 0.1
…to make the object move 0.1 units along the X axis at each timestep.
Usages in other examples
| Example name | Example for | |
|---|---|---|
| ClothSeam |
Cloth Create Seam surface node |
|
| AnimatedClothPatch |
Cloth Solver dynamics node |
|
| StitchedClothPatches |
Cloth Solver dynamics node |
|
| ClothAttachedDynamic |
Cloth Solver dynamics node |
|
| PinnedClothWind |
Cloth Solver dynamics node |
|
| ClothSpringsBalls |
Cloth Solver dynamics node |
|
| SphereClothCollision |
Cloth Solver dynamics node |
|
| SimpleSwitch |
Switch Solver dynamics node |
|
| SimpleFan |
Fan Force dynamics node |
|
| ParticlesAndCloth |
Particle Fluid Solver dynamics node |