Cloth - superclass: modifier; super-superclass:MAXWrapper - classID: #(1740754247, 2005071992)
The Cloth modifier implements the main element of the Cloth system introduced in 3ds Max 8. It provides access to all simulation parameters and controls the actual simulation process.
Constructor:
Cloth ...
Properties:
.showCurrentState (Show_Current_State) : boolean
Get/Set the state of the Show Current State checkbox in the Object rollout.
.showTargetState (Show_Target_State) : boolean
Get/Set the state of the Show Target State checkbox in the Object rollout.
.showEnabledSolidCollision BooleanClass default: false -- boolean; Show_Enabled_Solid_Collision
Get/Set the state of the Show enabled solid collision checkbox in the Object rollout.
.showEnabledClothCollision BooleanClass default: false -- boolean; Show_Enabled_Cloth_Collision
Get/Set the state of the Show enabled self collision checkbox in the Object rollout.
.cacheFile (Cache_File) : string
Get/Set the name of the cache file.
.forceUnc (Force_UNC_path) : boolean
Get/Set the state of the Force UNC Path checkbox. When set to true, a UNC path will be used for the cache file.
.exportCacheAs (Extra_Cache) : boolean
Get/Set whether to export the cache.
.overWriteCache (Overwrite_Cache_File) : boolean
Get/Set whether to overwrite the cache file.
.extraCacheFile (Extra_Cache_File) : string
Get/Set the extra cache file name.
.overWriteExtraCache (Force_UNC_path) : boolean
Get/Set whether to overwrite the extra cache file.
.method (Properties_Application_Method) : integer
Get/Set the material properties application method.
Possible values are:
0 - Interpolate (default)
1 - Texture Map
Corresponds to the radio buttons in the Material Params rollout.
.bias (Property_Bias) : float
Get/Set the material interpolation bias. Corresponds to the spinner/slider in the Material Params rollout.
.texture (TextureMap) : texmap
--Naming collision with the Group's .texture property.
.map (Map_Channel_Type) : integer
--Naming collision with the Group's .map property.
.mapChannel (Map_Channel) : integer
--Naming collision with the Group's .mapChannel property.
.useBendMap (Use_Bend_Map) : boolean
Enable/Disable the use of the Bend map. Corresponds to the checkbox in front of the Bend Map value in the Bend Map group of controls in the Selected Object Rollout.
.bendMapStrength (Bend_Map_Strength) : float
Get/Set the Bend map strenth. Corresponds to the Bend Map value spinner in the Bend Map group of controls in the Selected Object Rollout.
.bendMapSource (Bend_Map_Source) : integer
Get/Set the Bend map source. Corresponds to the radio buttons in the Bend Map group of controls in the Selected Object Rollout.
Possible values are:
0 - Vertex color (default)
1 - Map Channel
2 - Texture Map
.bendMapChannel (Bend_Map_Source_Vertex_Color_Channel) : integer
Get/Set the texture map channel when bendMapSource is set to 1. Corresponds to the Map Channel value in the Bend Map group of controls in the Selected Object Rollout.
.bendMap (Bend_Map) : texturemap
Get/Set the texture map to use as Bend Map. Corresponds to the map button in the Bend Map group of controls in the Selected Object Rollout.
.scale (cm_per_unit) : float
Get/Set the Scale value in cm/unit.
.useGravity (Use_Gravity) : boolean
Controls the state of the Gravity checkbutton.
.gravity : float
Get/Set the Gravity value.
.timestep (time_step) : float
Get/Set the Step value.
.subsample : integer
Get/Set the Subsample value.
.startFrame (start_frame) : integer
Get/Set the Start Frame value.
.enableEndFrame : boolean
Controls the state of the End Frame checkbox. When set to true, the end frame will be used.
.endFrame (End_Frame) : integer
Get/Set the End Frame value.
.selfCollision (self_collision) : boolean
Controls the state of the Self Collision checkbox. When set to true, the cloth will calculate self-collisions. Animatable.
.clothclothMethod (Cloth_Cloth_Method) : integer
Get/Set the Self-Collision value.
.checkIntersections (Check_Intersections) : boolean
Controls the state of the Check Intersections checkbox. When set to true, the cloth will check for self-intersections.
.solidCollision (solid_collision) : boolean
Controls the state of the Solid Collision checkbox. When set to true, the collision will be calculated as solid.
.useSewingSprings (Use_sewing_springs) : boolean
Controls the state of the Use Sewing Springs checkbox. When set to true, the sewing springs will be used.
.showSewingSprings (Show_sewing_springs) : boolean
Controls the state of the Show Sewing Springs checkbox. When set to true, the sewing springs will be shown.
.simOnRender (Simulate_on_Render) : boolean
Controls the state of the Sim On Render checkbox. When set to true, the simulation will be performed before rendering.
.simPriority (Sim_Priority) : integer
Get/Set the Simulation Priority value.
.advancedPinching (Advanced_Pinching) : boolean
Controls the state of the Advanced Pinching checkbox.
.relativeVelocity (Relative_Velocity_Adjustment) : float
Get/set the relative velocity adjustment value. Not exposed to the UI. Animatable.
.timeScale (Time_Scale) : float
Get/set the time scale value. Not exposed to the UI.
The following properties are accessible in Vertex Groups. By default, no Vertex Groups exist, resulting in an error message
-- Runtime error: Couldn't find a previously defined paramblock in Cloth
Be sure to create a vertex group before accessing vertex group parameters.
You can also access the properties by specifying the ReferenceTarget:ParamBlock2 as a property of the Cloth modifier. In this case, you might have to use the aliases given in brackets.
For Example:
$MyCloth.cloth.group01.Active
.groupName (Group_Name) : string
Get/Set the group name.
.ConstraintIsActive (Active) : boolean
Get/Set whether the constraint is active or not. Corresponds to the On checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
.ConstraintIsSoft (Is_Soft) : boolean
Get/Set whether the constraint is soft. Corresponds to the Soft checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
.ConstraintOffset (Offset) : float
Get/Set the constraint offset. Corresponds to the Offset spinner in the Group Parameters rollout > Constraint Parameters group of controls.
.OffsetRelative (Offset_is_Relative) : boolean
Get/Set whether the constraint is relative (true) or absolute (false). Corresponds to the rel checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
.constraintStrength (Strength) : float
Get/Set the constraint strength. Corresponds to the Strength spinner in the Group Parameters rollout > Constraint Parameters group of controls.
.useVertexColors (Use_Vertex_Colors) : boolean
Get/Set whether the constraint strength uses the vertex colors. Corresponds to the vc checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
.constraintDamping (Damping) : float
Get/Set the constraint damping. Corresponds to the Damping spinner in the Group Parameters rollout > Constraint Parameters group of controls.
.assigner_type (AssignerType) : integer
Get/Set the assigner type.
Possible values are:
0 - 1-to-1
1 - Blob
Corresponds to the radio buttons in the Group Parameters rollout.
.useRadius (Use_Radius) : boolean
Get/Set whether to use the radius value. Corresponds to the Radius checkbox in the Group Parameters rollout.
.radius : float
Get/Set the radius value. Corresponds to the Radius spinner in the Group Parameters rollout.
.useGroupBehavior (Use_Group_Behavior) : boolean
Get/Set the Behavior Settings checkbox in the behavior group of controls.
.groupsolidCollision (Grp_Solid_Collision) : boolean
Get/Set whether the to process solid collisions in the group.
.groupselfCollision (Grp_Self_Collision) : boolean
Get/Set whether the to process self collisions in the group.
.Layer : integer
Get/Set the Layer value in the behavior group of controls.
.keepShape (Keep_Shape) : boolean
Get/Set whether to try to keep the shape. Corresponds to the Keep Shape checkbox in the Group Parameters rollout, behavior group of controls.
.keepShapeFactor (Keep_Shape_Factor) : float
Get/Set the Keep Shape Factor value in the behavior group of controls.
.useGroupProperties (Use_Group_Properties) : boolean
Get/Set whether to use the group properties. Corresponds to the Use These Properties checkbox in the Group Parameters rollout.
.UbendResistance (U_Bend_Resistance) : float
Get/Set the bend resistance along U. Corresponds to the U Bend spinner in the Group Parameters rollout.
.VbendResistance (V_Bend_Resistance) : float
Get/Set the bend resistance along V. Corresponds to the V Bend spinner in the Group Parameters rollout.
.uBendCurve (U_Bend_Curve) : float
Get/Set the bend curve along U. Corresponds to the U B-Curve spinner in the Group Parameters rollout.
.vBendCurve (V_Bend_Curve) : float
Get/Set the bend curve along V. Corresponds to the V B-Curve spinner in the Group Parameters rollout.
.UstretchResistance (U_Strech_Resistance) : float
Get/Set the stretch resistance along U. Corresponds to the U Stretch spinner in the Group Parameters rollout.
.VstretchResistance (V_Stretch_Resistance) : float
Get/Set the stretch resistance along V. Corresponds to the V Stretch spinner in the Group Parameters rollout.
.shearResistance (Shear_Resistance) : float
Get/Set the Shear resistance. Corresponds to the Shear spinner in the Group Parameters rollout.
.density : float
Get/Set the cloth Density. Corresponds to the Density spinner in the Group Parameters rollout.
.thickness : float
Get/Set the cloth thickness. Corresponds to the Thickness spinner in the Group Parameters rollout.
.clothClothForce (Cloth_cloth_force) : float
Get/Set the cloth-cloth force. Corresponds to the Repulsion spinner in the Group Parameters rollout.
.stretchDamping (Stretch_Damping) : float
Get/Set the stretch damping. Corresponds to the Damping spinner in the Group Parameters rollout.
.airDamping (Air_Resistance) : float
Get/Set the air resistance value. Corresponds to the Air Res. spinner in the Group Parameters rollout.
.dynamicFriction (Dynamic_Friction) : float
Get/Set the dynamic friction.
.staticFriction (Static_Friction) : float
Get/Set the static friction.
.clothClothFriction (Cloth_cloth_Friction) : float
Get/Set the cloth-cloth friction. Corresponds to the Self Fric. spinner in the Group Parameters rollout.
.uScale (U_Scale) : float
Get/Set the scale along U.
.vScale (V_Scale) : float
Get/Set the scale along V.
.seamForce (Seam_Force) : float
Get/Set the seam force. Corresponds to the Seam Force spinner in the Group Parameters rollout.
.collisionDepth (Collision_Depth) : float
Get/Set the collision offset. Corresponds to the Depth spinner in the Group Parameters rollout.
.collisionOffset (Collision_Offset) : float
Get/Set the collision offset. Corresponds to the Offset spinner in the Group Parameters rollout.
.Plasticity : float
Get/Set the Plasticity value. Corresponds to the Plasticity spinner in the Group Parameters rollout.
.anisotropic : boolean
Get/Set whether to simulate the cloth as anisotropic. Corresponds to the Anisotropic checkbox in the Group Parameters rollout.
.useEdgeSprings (Use_Edge_Springs) : boolean
Get/Set whether to use Edge Springs. Corresponds to the Use Edge Springs checkbox in the Group Parameters rollout.
.useSolidDepthOffset (Use_Solid_Depth_Offset) : boolean
Get/Set the state of the Use Cloth Depth/Offset checkbox.
.useSolidFricion (Use_Solid_Friction) : boolean
Get/Set whether to use solid friction or not. Not exposed to the UI.
.useSoftSelection (Use_Soft_Selection) : boolean
Enable/Disable Soft Selection.
.softselUseEdgeDistance (Use_Edge_Distance) : boolean
Enable/Disable the use of Soft Selection distance.
.softselEdgeDist (Edge_Distance) : integer
Get/Set the Soft Selection Edge Distance value.
.softselAffectBackfacing (Affect_Backfacing) : boolean
When set to true, soft-selection affects vertices if back-facing faces.
.softselFalloff (Falloff) : world units
Get/Set the Soft Selection Falloff value.
.softselPinch (Pinch) : float
Get/Set the Soft Selection Pinch value.
.softselBubble (Bubble) : float
Get/Set the Soft Selection Bubble value.
.useTextureMap (Use_Texture_Map) : boolean
Get/Set whether to use the Texture map or not. Corresponds to the Use Texture Map checkbox in the Group Parameters rollout.
.texture (TextureMap) : texmap
Get/Set the Texture map to use. Corresponds to the Texture Map button in the Group Parameters rollout.
.mapChannel (Map_Channel) : integer
Get/Set the map channel to use. Corresponds to the Map Channel spinner in the Group Parameters rollout.
.map (Map_Channel_Type) : integer
Get/Set whether to use the specified Map channel or the Vertex Color channel. Corresponds to the Mapping Channel radio buttons in the Group Parameters rollout.
.frictionVelocityCutoff (Friction_Velocity_Cutoff) : float
Get/Set the friction velocity cutoff. Default is 30.0.
.matID (Constraint_MatID) : integer
Get/Set the Constraint Material ID.
.dynamic_node () : max object
Get/Set the Dynamic node.
Cloth Interfaces:
Interface: clothOps
Note:
This Interface is exposed by the Cloth Modifier and is NOT a global interface. The methods listed below can be accessed as methods of the Cloth Modifier itself without specifying the clotOps prefix. Sometimes the methods require the node to be passed as argument because the modifier could be instanced across multiple nodes and MAXScript needs to know which node to use,
For example
$MyObject.modifiers[#Cloth].numberVertices $MyObject
--or
$MyObject.Cloth.numberVertices $MyObject
--which is equivalent to
$MyObject.Cloth.clothOps.numberVertices $MyObject
Methods:
<integer>numberVertices <node>node
Returns the number of vertices in the cloth
<void>selectVertices <bitArray>sel <node>node
Selects the vertices specified by the bitArray in the supplied node.
<bitArray>getSelectedVertices <node>node
Returns the selected vertices in the supplied node as bitArray.
<void>makeConstraint <string>groupname <string>type <node>target_node
Makes a constraint from the given group using the specified type and target node.
<integer>makePointGroup <bitArray>vertex_sel <node>node <string>name
Creates a Point Group with the supplied name from the vertices specified by the bitArray in the supplied node.
<void>deletePointgroup <string>groupname
Deletes the Point Group with the supplied name.
<void>initPointgroup <string>groupname
Initializes the Point Group with the supplied name.
<void>detachPointgroup <string>groupname
Detaches the Point Group with the supplied name.
<void>makeGroupConstraint <string>groupname <string>target_group
Constrains the Point Group with the supplied name to the target group with the supplied name.
<void>simulate <boolean>show_dialog
Starts the simulation. If the parameter is true, shows the simulation dialog.
<void>simulateLocal <integer>stop_condition <float>param <boolean>damped
Starts a local simulation.
<void>stopLocalSimulation()
Stops the local simulation.
<void>eraseSimulation()
Erases the current simulation. Corresponds to pressing the "Erase Simulation" button in the Cloth modifier's UI.
<void>truncateSimulation()
Truncates the current simulation. Corresponds to pressing the "Truncate Simulation" button in the Cloth modifier's UI.
<void>setInitialState <node>node
Sets the current cloth state as the initial state. Corresponds to pressing the "Set Initial State" button in the Cloth modifier's UI.
<void>resetState <node>node
Resets the cloth state. Corresponds to pressing the "Reset State" button in the Cloth modifier's UI.
<void>delObjectCache <node>node
Deletes the Object Cache. Corresponds to pressing the "Delete Object Cache" button in the Cloth modifier's UI.
<void>setObjectType <node>node <integer>type <boolean>updateSim
Sets the object type of the specified node to the type specified by the integer parameter. If updateSim is true, updates the simulation.
Possible type integer values are:
0 - Inactive
1 - Collision Object
2 - Cloth
<integer>getObjectType <node>node
Returns the object type of the specified node as integer.
Possible return values are:
0 - Inactive
1 - Collision Object
2 - Cloth
<void>setObjectProperty <node>node <string>property <fpvalue by value>value
Sets the object property specified by the string name to the supplied value in the specified node.
<string array>showObjectProperties()
Returns an array of strings containing all supported object property names.
<void>grabState <node>node
Grabs the state of the cloth. Corresponds to pressing the "Grab State" button in the Cloth modifier's UI.
<void>addForceField <node>node
Adds the specified Space Warp force to the list of Cloth Forces.
<void>removeForceField <node>node
Removes the specified Space Warp force from the list of Cloth Forces.
<void>flagParticles <bitArray>sel
For internal use only.
<void>exportCache <node>node <string>filename
Exports a cache file for the specified node to the given file name.
<void>importCache <node>node <string>filename
Imports a cache file for the specified node from the given file name.
<void>loadCache <node>node
Loads the cache for the specified node.
<void>loadAllCaches()
Loads all caches.
<void>saveCache <node>node
Saves the cache for the specified node.
<void>saveExtraCache <node>node
Saves an extra cache for the specified node.
<void>saveAllCaches()
Saves all caches.
<void>saveAllExtraCaches()
Saves all extra caches.
<paramBlock2>getObjectParamBlock <node>node
Returns the parameter block of the specified node.
<paramBlock2>getGroupParamBlock <string>groupname
Returns the parameter block of the specified named group.
See also
MAXScript Extensions for Cloth
Modifier Common Properties, Operators, and Methods
MAXWrapper Common Properties, Operators, and Methods
Value Common Properties, Operators, and Methods