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.
Constructors
Cloth...
Clothfx...Properties
<Cloth>.showCurrentState BooleanClass default: false -- boolean; Show_Current_StateGets/sets the state of the Show Current State checkbox in the Object rollout.
<Cloth>.showTargetState BooleanClass default: false -- boolean; Show_Target_StateGets/sets the state of the Show Target State checkbox in the Object rollout.
<Cloth>.showEnabledSolidCollision BooleanClass default: false -- boolean; Show_Enabled_Solid_CollisionGets/sets the state of the Show enabled solid collision checkbox in the Object rollout.
<Cloth>.showEnabledClothCollision BooleanClass default: false -- boolean; Show_Enabled_Cloth_CollisionGets/sets the state of the Show enabled self collision checkbox in the Object rollout.
<Cloth>.scaleFloat default: 2.54 -- float; cm_per_unitGets/sets the Scale value in cm/unit.
<Cloth>.useGravit yBooleanClass default: true -- boolean; Use_GravityControls the state of the Gravity checkbutton.
<Cloth>.gravity Float default: -980.0 -- animatable; floatGets/sets the Gravity value.
<Cloth>.timestep Float default: 0.02 -- animatable; float; time_stepGets/sets the Step value.
<Cloth>.subsample Integer default: 1 -- animatable; integerGets/sets the Sub sample value.
<Cloth>.startFrame Integer default: 0 -- integer; start_frameGets/sets the Start Frame value.
<Cloth>.enableEndFrame BooleanClass default: false -- booleanControls the state of the End Frame checkbox. When set to true, the end frame will be used.
<Cloth>.endFrame Integer default: 100 -- integer; End_FrameGets/sets the End Frame value.
<Cloth>.selfCollision BooleanClass default: false -- animatable; boolean; self_collisionControls the state of the Self Collision checkbox. When set to true, the cloth will calculate self-collisions. Animatable.
<Cloth>.clothclothMethod Integer default: 0 -- animatable; integer; Cloth_Cloth_MethodGets/sets the Self-Collision value.
<Cloth>.checkIntersections BooleanClass default: false -- boolean; Check_IntersectionsControls the state of the Check Intersections checkbox. When set to true, the cloth will check for self-intersections.
<Cloth>.solidCollision BooleanClass default: true -- animatable; boolean; solid_collisionControls the state of the Solid Collision checkbox. When set to true, the collision will be calculated as solid.
<Cloth>.useSewingSpring sBooleanClass default: true -- boolean; Use_sewing_springsControls the state of the Use Sewing Springs checkbox. When set to true, the sewing springs will be used.
<Cloth>.showSewingSprings BooleanClass default: true -- boolean; Show_sewing_springsControls the state of the Show Sewing Springs checkbox. When set to true, the sewing springs will be shown.
<Cloth>.simOnRender BooleanClass default: false -- boolean; Simulate_on_RenderControls the state of the Sim On Render checkbox. When set to true, the simulation will be performed before rendering.
<Cloth>.simPriorityInteger default: 1 -- integer; Sim_PriorityGets/sets the Simulation Priority value. When Sim On Render is enabled, this value defines the priority of the Cloth simulation to determine the order in which the simulations will be performed.
<Cloth>.advancedPinching BooleanClass default: false -- animatable; boolean; Advanced_PinchingControls the state of the Advanced Pinching checkbox.
<Cloth>.showTension BooleanClass default: false -- boolean; Show_TensionControls the state of the Tension checkbox. When set to true, shows the tension of the cloth using colors.
<Cloth>.tensionScale Float default: 1.0 -- float; Tension_ScaleGets/sets the Tension Scale value used when. showTension is set to true. Corresponds to the Tension spinner.
<Cloth>.relativeVelocity Float default: 0.0 -- animatable; float; Relative_Velocity_AdjustmentGets/sets the relative velocity adjustment value. Not exposed to the UI. Animatable.
<Cloth>.timeScale Float default: 1.0 -- animatable; float; Time_ScaleGets/sets the time scale value. Not exposed to the UI. Animatable.
<Cloth>.weldMethod Integer default: 1 -- integer; Weld_MethodGets/sets the index of the welding method radio buttons.
Possible values are:
0 - Verts
1 - Normals (default)
Available in 3ds Max 2010 and higher.
<Cloth>.ignoreBackfacing BooleanClass default: false -- boolean; Ignore_BackfacingGets/sets the state of the Ignore Backfacing option.
<Cloth>.simOnMouseDown BooleanClass default: true -- boolean; Sim_on_Mouse_DownGets/sets the state of the Simulate On Mouse Down option.
The following properties are accessible as properties of the Cloth Object ParamBlock2 accessed using the method. getObjectParamBlock() exposed by the ClothOps Mixin Interface. This Parameter Block is associated with a scene object that has a Cloth Modifier applied to it. There is one ReferenceTarget:ParamBlock2 for each object the Cloth Modifier is applied to.
The same ParamBlock2 can be accessed as a property of the Cloth Modifier. The name of the property consists of the name of the scene node followed by "_properties".
FOR EXAMPLE
mySphere = sphere() myCloth = cloth() addmodifier mySphere myCloth thePB2 = mySphere.cloth.getObjectParamBlock $Sphere001 thePB2.Use_Bend_Map --which is equivalent to $Sphere001.cloth.Sphere001_properties.useBendMap
<Cloth><ParamBlock2>.cacheFile (Cache_File) : stringGets/sets the name of the cache file.
<Cloth><ParamBlock2>.forceUnc (Force_UNC_path) : booleanGets/sets the state of the Force UNC Path checkbox. When set to true, a UNC path will be used for the cache file.
<Cloth><ParamBlock2>.exportCacheAs (Extra_Cache) : booleanGets/sets whether to export the cache.
<Cloth><ParamBlock2>.overWriteCache (Overwrite_Cache_File) : booleanGets/sets whether to overwrite the cache file.
<Cloth><ParamBlock2>.extraCacheFile (Extra_Cache_File) : stringGets/sets the extra cache file name.
<Cloth><ParamBlock2>.overWriteExtraCache: booleanGets/sets whether to overwrite the extra cache file.
<Cloth><ParamBlock2>.method (Properties_Application_Method) : integerGets/sets the material properties application method.
Corresponds to the radio buttons in the Property Assignment Group of controls.
Possible values are:
0 - Interpolate(default)
1 - Texture Map
<Cloth><ParamBlock2>.bias (Property_Bias) : floatGets/sets the material interpolation bias. Corresponds to the spinner/slider in the Property Assignment Group of controls.
<Cloth><ParamBlock2>.objectMap (Object_Map) :texturemapGets/sets the Texture Map.
<Cloth><ParamBlock2>.objectMapChannel (Object_Map_Channel) :integerGets/sets the Mapping Channel.
<Cloth><ParamBlock2>.useBendMap (Use_Bend_Map) : booleanEnables/disables 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.
<Cloth><ParamBlock2>.bendMapStrength (Bend_Map_Strength) : floatGets/sets the Bend map strength. Corresponds to the Bend Map value spinner in the Bend Map group of controls in the Selected Object Rollout.
<Cloth><ParamBlock2>.bendMapSource (Bend_Map_Source) : integerGets/sets 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
<Cloth><ParamBlock2>.bendMapChannel (Bend_Map_Source_Vertex_Color_Channel) : integerGets/sets 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.
<Cloth><ParamBlock2>.bendMap (Bend_Map) : texturemapGets/sets 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.
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 either use the . getGroupParamBlock() method exposed by the ClothOps Mixin Interface documented later in this topic or 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
theGroupRT = mySphere.cloth.getGroupParamBlock() theGroupRT.Active --which is equivalent to mySphere.cloth.group01.Active
<Cloth>.<Group>.groupName(Group_Name) : stringGets/sets the group name.
<Cloth>.<Group>.ConstraintIsActive (Active): booleanGets/sets whether the constraint is active or not. Corresponds to the On checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.ConstraintIsSoft (Is_Soft): booleanGets/sets whether the constraint is soft. Corresponds to the Soft checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.ConstraintOffset (Offset): floatGets/sets the constraint offset. Corresponds to the Offset spinner in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.OffsetRelative (Offset_is_Relative): booleanGets/sets whether the constraint is relative (true) or absolute (false).Corresponds to the rel checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.constraintStrength (Strength): floatGets/sets the constraint strength. Corresponds to the Strength spinner in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.useVertexColors (Use_Vertex_Colors): booleanGets/sets whether the constraint strength uses the vertex colors. Corresponds to the vc checkbox in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.constraintDamping (Damping): floatGets/sets the constraint damping. Corresponds to the Damping spinner in the Group Parameters rollout > Constraint Parameters group of controls.
<Cloth>.<Group>.assigner_type (AssignerType) : integerGets/sets the assigner type.
Possible values are:
0 - 1-to-1
1 - Blob
Corresponds to the radio buttons in the Group Parameters rollout.
<Cloth>.<Group>.useRadius (Use_Radius) : booleanGets/sets whether to use the radius value. Corresponds to the Radius checkbox in the Group Parameters rollout.
<Cloth>.<Group>.radius: floatGets/sets the radius value. Corresponds to the Radius spinner in the Group Parameters rollout.
<Cloth>.<Group>.useGroupBehavior (Use_Group_Behavior) : booleanGets/sets the BehaviorSettings checkbox in the behavior group of controls.
<Cloth>.<Group>.groupsolidCollision (Grp_Solid_Collision): booleanGets/sets whether the to process solid collisions in the group.
<Cloth>.<Group>.groupselfCollision (Grp_Self_Collision): booleanGets/sets whether the to process self collisions in the group.
<Cloth>.<Group>.Layer: integerGets/sets the Layer value in the behavior group of controls.
<Cloth>.<Group>.keepShape (Keep_Shape) : booleanGets/sets whether to try to keep the shape. Corresponds to the Keep Shape checkbox in the Group Parameters rollout, behavior group of controls.
<Cloth>.<Group>.keepShapeFactor (Keep_Shape_Factor) : floatGets/sets the Bend % value in the behavior group of controls.
<Cloth>.<Group>.keepShapeEdgeLengthsFactor (Keep_Shape_Edge_Lenghts_Factor) : floatGets/sets the Stretch % value in the behavior group of controls.
<Cloth>.<Group>.useGroupProperties (Use_Group_Properties) : booleanGets/sets whether to use the group properties. Corresponds to the Use These Propertiescheckbox in the Group Parameters rollout.
<Cloth>.<Group>.UbendResistance (U_Bend_Resistance) : floatGets/sets the bend resistance along U. Corresponds to the UBend spinner in the Group Parameters rollout.
<Cloth>.<Group>.VbendResistance (V_Bend_Resistance) : floatGets/sets the bend resistance along V. Corresponds to the Bend spinner in the Group Parameters rollout.
<Cloth>.<Group>.uBendCurve (U_Bend_Curve) : floatGets/sets the bend curve along U. Corresponds to the UB-Curve spinner in the Group Parameters rollout.
<Cloth>.<Group>.vBendCurve (V_Bend_Curve) : floatGets/sets the bend curve along V. Corresponds to the VB-Curve spinner in the Group Parameters rollout.
<Cloth>.<Group>.UstretchResistance (U_Strech_Resistance) : floatGets/sets the stretch resistance along U. Corresponds to the U Stretch spinner in the Group Parameters rollout.
<Cloth>.<Group>.VstretchResistance (V_Stretch_Resistance) : floatGets/sets the stretch resistance along V. Corresponds to the V Stretch spinner in the Group Parameters rollout.
<Cloth>.<Group>.UCompressionResistance (U_Compression_Resistance) : floatGets/sets the compression resistance along U.
Corresponds to the UCompress spinner in the Group Parameters rollout.
Available in 3ds Max 2010 and higher.
<Cloth>.<Group>.UCompressionResistance (U_Compression_Resistance) : floatGets/sets the compression resistance along V.
Corresponds to the VCompress spinner in the Group Parameters rollout.
Available in 3ds Max 2010 and higher.
<Cloth>.<Group>.shearResistance (Shear_Resistance) : floatGets/sets the Shear resistance. Corresponds to the Shear spinner in the Group Parameters rollout.
<Cloth>.<Group>.density: floatGets/sets the cloth Density. Corresponds to the Density spinner in the Group Parameters rollout.
<Cloth>.<Group>.thickness: floatGets/sets the cloth thickness. Corresponds to the Thickness spinner in the Group Parameters rollout.
<Cloth>.<Group>.clothClothForce (Cloth_cloth_force) : floatGets/sets the cloth-cloth force. Corresponds to the Repulsion spinner in the Group Parameters rollout.
<Cloth>.<Group>.stretchDamping (Stretch_Damping) : floatGets/sets the stretch damping. Corresponds to the Damping spinner in the Group Parameters rollout.
<Cloth>.<Group>.airDamping (Air_Resistance) : floatGets/sets the air resistance value. Corresponds to the Air Res. spinner in the Group Parameters rollout.
<Cloth>.<Group>.dynamicFriction (Dynamic_Friction) : floatGets/sets the dynamic friction. Corresponds to the Dyn Fric. spinner in the Group Parameters rollout.
<Cloth>.<Group>.staticFriction (Static_Friction) : floatGets/sets the static friction. Corresponds to the Static Fric. spinner in the Group Parameters rollout.
<Cloth>.<Group>.clothClothFriction (Cloth_cloth_Friction) : floatGets/sets the cloth-cloth friction. Corresponds to the Self Fric. spinner in the Group Parameters rollout.
<Cloth>.<Group>.uScale (U_Scale) : floatGets/sets the scale along U. Corresponds to the U Scale spinner in the Group Parameters rollout.
<Cloth>.<Group>.vScale (V_Scale) : floatGets/sets the scale along V. Corresponds to the V Scale spinner in the Group Parameters rollout.
<Cloth>.<Group>.seamForce (Seam_Force) : floatGets/sets the seam force. Corresponds to the Seam Force spinner in the Group Parameters rollout.
<Cloth>.<Group>.collisionDepth (Collision_Depth) : floatGets/sets the collision offset. Corresponds to the Depth spinner in the Group Parameters rollout.
<Cloth>.<Group>.collisionOffset (Collision_Offset) : floatGets/sets the collision offset. Corresponds to the Offset spinner in the Group Parameters rollout.
<Cloth>.<Group>.Plasticity: floatGets/sets the Plasticity value. Corresponds to the Plasticity spinner in the Group Parameters rollout.
<Cloth>.<Group>.Stickiness: floatGets/sets the Plasticity value.
Corresponds to the Cling spinner in the Group Parameters rollout.
Available in 3ds Max 2010 and higher.
<Cloth>.<Group>.Pressure (Pressure) : floatGets/sets the Pressure value.
Corresponds to the Pressure spinner in the Group Parameters rollout.
Available in 3ds Max 2010 and higher.
<Cloth>.<Group>.PressureDamping (Pressure_Damping) : floatGets/sets the Pressure Damping value.
Corresponds to the Press. Damp spinner in the Group Parameters rollout.
Available in 3ds Max 2010 and higher.
<Cloth>.<Group>.anisotropic: booleanGets/sets whether to simulate the cloth as anisotropic. Corresponds to the Anisotropic checkbox in the Group Parameters rollout.
<Cloth>.<Group>.useEdgeSprings (Use_Edge_Springs) : booleanGets/sets whether to use Edge Springs. Corresponds to the UseEdge Springs checkbox in the Group Parameters rollout.
<Cloth>.<Group>.useSolidDepthOffset (Use_Solid_Depth_Offset) : booleanGets/sets the state of the Use Cloth Depth/Offset checkbox.
<Cloth>.<Group>.useSolidFricion (Use_Solid_Friction) : booleanGets/sets whether to use solid friction or not. Not exposed to the UI.
<Cloth>.<Group>.useSoftSelection (Use_Soft_Selection) : booleanEnables/disables Soft Selection.
<Cloth>.<Group>.softselUseEdgeDistance (Use_Edge_Distance) : booleanEnables/disables the use of Soft Selection distance.
<Cloth>.<Group>.softselEdgeDist (Edge_Distance) : integerGets/sets the Soft Selection Edge Distance value.
<Cloth>.<Group>.softselAffectBackfacing (Affect_Backfacing) : booleanWhen set to true, soft-selection affects vertices if back-facing faces.
<Cloth>.<Group>.softselFalloff (Falloff) : world unitsGets/sets the Soft Selection Falloff value.
<Cloth>.<Group>.softselPinch (Pinch) : floatGets/sets the Soft Selection Pinch value.
<Cloth>.<Group>.softselBubble (Bubble) : floatGets/sets the Soft Selection Bubble value.
<Cloth>.<Group>.useTextureMap (Use_Texture_Map) : booleanGets/sets whether to use the Texture map or not. Corresponds to the Use TextureMap checkbox in the Group Parameters rollout.
<Cloth>.<Group>.texture (TextureMap) : texmapGets/sets the Texture map to use. Corresponds to the TextureMap button in the Group Parameters rollout.
<Cloth>.<Group>.mapChannel (Map_Channel) : integerGets/sets the map channel to use. Corresponds to the MapChannel spinner in the Group Parameters rollout.
<Cloth>.<Group>.map (Map_Channel_Type) : integerGets/sets whether to use the specified Map channel or the Vertex Color channel. Corresponds to the Mapping Channel radio buttons in the Group Parameters rollout.
<Cloth>.<Group>.frictionVelocityCutoff (Friction_Velocity_Cutoff) : floatGets/sets the friction velocity cutoff. Default is 30.0.
<Cloth>.<Group>.matID (Constraint_MatID) : integerGets/sets the Constraint Material ID.
Cloth interfaces
Interface:clothOpsThe clothOps Interface is a Mixin Interface 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 clothOps prefix.
Sometimes the methods require the node to be passed as argument because the modifier can be instanced across multiple nodes and MAXScript needs to know which node to use. See the example below:
FOR EXAMPLE
mySphere.modifiers[#Cloth].numberVertices mySphere --or mySphere.Cloth.numberVertices mySphere --which is equivalent to mySphere.Cloth.clothOps.numberVertices mySphere
Methods
<paramBlock2>getObjectParamBlock <node>nodeReturns the parameter block Reference Target of the specified node.
<paramBlock2>getGroupParamBlock <string>groupnameReturns the parameter block Reference Target of the specified named group. This can be used to access the Group parameters.
<integer>numberVertices <node>nodeReturns the number of vertices in the cloth.
<void>selectVertices <bitArray> sel <node> nodeSelects the vertices specified by the bitArray in the supplied node.
<bitArray>getSelectedVertices <node> nodeReturns the selected vertices in the supplied node as bitArray.
<void>makeConstraint <string>groupname <string> type <node> target_nodeMakes a constraint from the given group using the specified type and target node.
<integer>makePointGroup <bitArray> vertex_sel <node>node <string> nameCreates a Point Group with the supplied name from the vertices specified by the bitArray in the supplied node.
<void>deletePointgroup <string> groupnameDeletes the Point Group with the supplied name.
<void>initPointgroup <string> groupnameInitializes the Point Group with the supplied name.
<void>detachPointgroup <string> groupnameDetaches the Point Group with the supplied name.
<void>makeGroupConstraint <string> groupname <string> target_groupConstrains the Point Group with the supplied name to the target group with the supplied name.
<void>simulate <boolean> show_dialogStarts the simulation. If the parameter is true, shows the simulation dialog.
<void>simulateLocal <integer> stop_condition <float> param <boolean> dampedStarts 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>nodeSets 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>nodeResets the cloth state. Corresponds to pressing the "Reset State" button in the Cloth modifier's UI.
<void>delObjectCache <node>nodeDeletes the Object Cache. Corresponds to pressing the "Delete Object Cache" button in the Cloth modifier's UI.
<void>setObjectType <node> node <integer> type <boolean>updateSimSets 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>nodeReturns 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 <value> valueSets the object property specified by the string name to the supplied value in the specified node.
<stringarray>showObjectProperties()Returns an array of strings containing all supported object property names.
<void>grabState <node> nodeGrabs the state of the cloth. Corresponds to pressing the "Grab State" button in the Cloth modifier's UI.
<void>addForceField <node>nodeAdds the specified Space Warp force to the list of Cloth Forces.
<void>removeForceField <node>nodeRemoves the specified Space Warp force from the list of Cloth Forces.
<void>flagParticles <bitArray>selFor internal use only.
<void>exportCache <node> node <string> filenameExports a cache file for the specified node to the given file name.
<void>importCache <node> node <string> filenameImports a cache file for the specified node from the given file name.
<void>loadCache <node> nodeLoads the cache for the specified node.
<void>loadAllCaches()Loads all caches.
<void>saveCache <node>nodeSaves the cache for the specified node.
<void>saveExtraCache <node>nodeSaves an extra cache for the specified node.
<void>saveAllCaches()Saves all caches.
<void>saveAllExtraCaches()Saves all extra caches.
<integer>makeTear <bitArray> vertex_sel <node> node <string> nameCreates a tear in the node specified as second argument defined by the vertex selection specified by the bitArray passed as first argument and named as the string passed as third argument.
Returns the index of the tear.
Available in 3ds Max 2010 and higher.
<void>clearTears <node> nodeClears all tears in the specified node.
Available in 3ds Max 2010 and higher.
<value> getObjectProperty <node> node <string> propertyReturns the value of the node's property.
The first argument specifies the node to get the property from.
The second argument specifies the name of the property as a string.
The return value depends on the property's type.
Available in 3ds Max 2011 and higher.