mCloth - superclass: modifier; super-superclass:MAXWrapper - 65:0 - classID:#(685326, 452282) The mCloth modifier implements the MassFX compatible component of the Cloth system of 3ds Max.
Available in 3ds Max 2013 and higher.
Constructor:
mCloth... Properties:
<mCloth>.behavior Integer default: 0; Cloth_behaviorGet/set the state of the "Cloth Behavior" drop-down list.
Possible values are:
0 - Dynamic
1 - Kinematic
<mCloth>.untilframeenable Boolean default: False; until_frameGet/set the state of the "Unit Frame" checkbox.
<mCloth>.kinematic_until_frame Float default: 0Get/set the value of the "Unit Frame" spinner
<mCloth>.inherit_velocity Boolean default: FalseGet/set the state of the "Inherit Velocity" checkbox.
<mCloth>.enablelivedrag Boolean default: False; Enable_Live_DragGet/set the state of the "Live Drag" checkbutton.
Currently no effect.
<mCloth>.do_gravity Boolean default: TrueGet/set the state of the "Use Global Gravity" checkbox.
When set to True, the Gravity settings of the MassFX Dialog will be used.
When set to False, the global Gravity will be ignored.
<mCloth>.forceList Array default: #()Get/set the list of Scene Forces to apply to the Cloth simulation.
<mCloth>.showCurrentState Boolean default: False; Show_Current_State<mCloth>.showTargetState Boolean default: False; Show_Target_State<mCloth>.gravity Float default: 1.0Get/set the value of the "Gravity Scale" spinner.
<mCloth>.density Float default: 50.0Get/set the value of the "Density" spinner.
<mCloth>.stretchiness Float default: 0.0; Stretching_StiffnessGet/set the value of the "Stretchiness" spinner.
<mCloth>.bendiness Float default: 0.0; Bend_StiffnessGet/set the value of the "Bendiness" spinner.
<mCloth>.do_bending_ortho Boolean default: TrueGet/set the state of the "Use Ortho Bending" checkbox.
<mCloth>.damping_coefficient Float default: 0.5; DampingGet/set the value of the "Damping" spinner.
<mCloth>.friction Float default: 0.5Get/set the value of the "Friction" spinner.
<mCloth>.compressions_limit Float default: 1.0; compression_limitGet/set the value of the "Compression > Limit" spinner.
<mCloth>.compressions_stiffness Float default: 1.0; compression_stiffnessGet/set the value of the "Compression > Stiffness" spinner.
<mCloth>.do_pressure Boolean default: False<mCloth>.pressure Float default: 0.0<mCloth>.self_collision Boolean default: True; enable_self_collisionGet/set the state of the "Self Collisions" checkbox.
<mCloth>.self_thickness Float default: 0.2; Self_Collision_ThicknessGet/set the value of the "Self Thickness spinner.
<mCloth>.enable_collision Boolean default: TrueGet/set the state of the "Collide To Rigid Objects" checkbox.
<mCloth>.thickness Float default: 0.01Get/set the value of the "Thickness" spinner.
<mCloth>.two_way_collision Boolean default: True; do_two_way_collisionsGet/set the state of the "Push Rigid Objects" checkbox.
<mCloth>.attachToCollide Boolean default: False; Attach_to_CollideGet/set the state of the "Attach To Colliders" checkbox.
<mCloth>.attachment_response_coefficient Float default: 0.2; attachment_response_coeffGet/set the value of the "Influence" spinner.
<mCloth>.attachment_tear_factor Float default: 1.5Get/set the value of the "Detach Past" spinner.
<mCloth>.tearable Boolean default: FalseGet/set the state of the "Allow Tearing" checkbox.
<mCloth>.tear_factor Float default: 1.5Get/set the value of the "Tear Past" spinner.
<mCloth>.weldMethod Integer default: 1; Weld_MethodGet/set the state of the "Weld Prior To Tearing" radio buttons control.
Possible values are:
0 - Vertices
1 - Normals
2 - Don't Weld
<mCloth>.showTension Boolean default: False; Show_TensionGet/set the state of the "Tension" checkbox.
<mCloth>.tensionScale Float default: 1.0; Tension_ScaleGet/set the value of the "Tension" spinner.
<mCloth>.do_hard_stretch_limitation Boolean default: FalseGet/set the state of the "Anti-Stretch" checkbox.
<mCloth>.hard_stretch_limitation Float default: 1.0Get/set the value of the "Limit" spinner.
<mCloth>.com_damping Boolean default: False; do_com_dampingGet/set the state of the "Use COM Damping" checkbox.
<mCloth>.hardware Boolean default: False; do_hardware_simulationGet/set the state of the "Hardware Acceleration" checkbox.
<mCloth>.solver_iterations Integer default: 5Get/set the value of the "Solver Iter." spinner.
<mCloth>.Hierarchical_Solver_Iterations Integer default: 2Get/set the value of the "Hier. Sol. Iter." spinner.
<mCloth>.hierarchical_Levels Integer default: 0Get/set the value of the "Hier. Levels" spinner.
<mCloth>.cacheFile String default: undefined; Cache_FileGet/set the cache file name.
<mCloth>.simOnRender Boolean default: False; Simulate_on_RenderGet/set the simulate on render option. Default is False. When set to True, mCloth simulation can be performed before rendering if necessary.
<mCloth>.do_bending Boolean default: TrueGet/set the state of the Do Bending option. Default is True. When set to False, no bending will be simulated.
<mCloth>.do_damping Boolean default: TrueGet/set the state of the Do Damping option. Default is True. When set to False, no damping will be performed.
<mCloth>.do_untangling Boolean default: FalseGet/set whether to perform untangling. Default is False. When set to True, the mCloth will attempt to untangle.
<mCloth>.do_inter_collision Boolean default: FalseGet/set whether to perform inter-collisions. Default is False. When set to True, the mCloth will calculate inter-collisions.
<mCloth>.do_adhere Boolean default: FalseGet/set the enabled state of the Adhere option. Default is False. When set to True, the cloth will adhere to rigid bodies it collided with.
<mCloth>.min_adhere_velocity Float default: 1.0Get/set the minimum adhere velocity.
<mCloth>.do_fluid_collision Boolean default: FalseGet/set the state of the Fluid Collision option. Default is False. When set to True, fluid collisions will be calculated.
<mCloth>.disable_dynamic_ccd Boolean default: TrueGet/set the disabled state of Dynamic Continuous Collision Detection option. Default is True. When set to False, dynamic CCD will be performed.
<mCloth>.collision_response_coefficient Float default: 1.0Get/set the Collision Response coefficient. This can be used to scale up and down the response to collisions.
<mCloth>.to_fluid_response_coefficient Float default: 1.0; to_fluid_response_coeffGet/set the Collision Response To Fluid coefficient.
<mCloth>.from_fluid_response_coefficient Float default: 1.0; from_fluid_response_coeffGet/set the Collision Response From Fluid coefficient.
<mCloth>.is_static Boolean default: FalseGet/set the Static state of the mCloth. Default is false.
<mCloth>.visualization Boolean default: FalseGet/set the enabled state of the Visualization.
<mCloth>.validbounds Boolean default: False; do_valid_boundsGet/set whether to validate bounds.
<mClothGroup>.useSoftSelection Boolean default: False; Use_Soft_SelectionGet/set the state of the Soft-Selection "Use Soft-Selection" checkbox.
<mClothGroup>.softselUseEdgeDistance Boolean default: False; Use_Edge_DistanceGet/set the state of the Soft-Selection "Edge Distance" checkbox.
<mClothGroup>.softselEdgeDist Integer default: 1; Edge_DistanceGet/set the value of the Soft-Selection "Edge Distance" spinner.
<mClothGroup>.softselAffectBackfacing Boolean default: True; Affect_BackfacingGet/set the state of the Soft-Selection "Edge Distance" checkbox.
<mClothGroup>.softselFalloff Float default: 20.0; FalloffGet/set the value of the Soft-Selection "Falloff" spinner.
<mClothGroup>.softselPinch Float default: 0.0; PinchGet/set the value of the Soft-Selection "Pinch" spinner.
<mClothGroup>.softselBubble Float default: 0.0; BubbleGet/set the value of the Soft-Selection "Bubble" spinner.
<mClothGroup>.useTextureMap Boolean default: False; Use_Texture_MapGet/set the state of the Soft-Selection "Use Texture Map" checkbox.
<mClothGroup>.texture Map default: undefined; TextureMapGet/set the texture map of the Soft-Selection .
<mClothGroup>.map Integer default: 0; Map_Channel_TypeGet/set the state of the Soft-Selection "Mapping Channel" radio buttons.
Possible values are:
0 - Map
1 - Vertex Color
<mClothGroup>.mapChannel Integer default: 1; Map_ChannelGet/set the value of the Soft-Selection "Map" spinner.
When a named Point Group is created in the mCloth modifier, it will appear as a property of the mCloth with the same name as the group definition, e.g Group001.
Alternatively, you can use the mClothOps Interface's method <mCloth>.getGroupParamBlock <GroupName> to get the Parameter Block of the Group by name and access its properties.
A Group exposes the following properties:
<mClothGroup>.Active Boolean default: TrueGet/set the state of the Group Constraint's "On" checkbox.
<mClothGroup>.Is_Soft Boolean default: FalseGet/set the state of the Group Constraint's "Soft Constraint" checkbox.
<mClothGroup>.Strength Float default: 100.0Get/set the value of the Group Constraint's "Strength" spinner.
<mClothGroup>.Damping Float default: 10.0Get/set the value of the Group Constraint's "Damping" spinner.
<mClothGroup>.Use_Edge_Distance Boolean default: FalseGet/set the state of the Group Constraint's "Edge Distance" checkbox.
<mClothGroup>.Edge_Distance Integer default: 1Get/set the value of the Group's Soft-Selection "Edge Distance" spinner.
<mClothGroup>.Affect_Backfacing Boolean default: TrueGet/set the state of the Group Constraint's "Edge Distance" checkbox.
<mClothGroup>.Falloff Float default: 20.0Get/set the value of the Group's Soft-Selection "Falloff" spinner.
<mClothGroup>.Pinch Float default: 0.0Get/set the value of the Group's Soft-Selection "Pinch" spinner.
<mClothGroup>.Bubble Float default: 0.0Get/set the value of the Group's Soft-Selection "Bubble" spinner.
<mClothGroup>.Use_Texture_Map Boolean default: FalseGet/set the state of the "Use Texture Map" checkbox.
<mClothGroup>.Map_Channel_Type Integer default: 0 Get/set the Group's Mapping Channel Type.
Possible values are:
0 - Map
1 - Vertex Color
<mClothGroup>.mapChannel Integer default: 1; Map_ChannelGet/set the Group's Map Channel. Valid values are in the range from 1 to 99.
<mClothGroup>.Group_Name String default: "Group001"Get/set the name of the group.
<mClothGroup>.Offset Float default: 1.0Get/set the Offset value.
Unexposed to the UI.
<mClothGroup>.Offset_is_Relative Boolean default: TrueGet/set whether the offset is relative or absolute.
Unexposed to the UI.
<mClothGroup>.Use_Vertex_Colors Boolean default: FalseUnexposed to the UI.
Methods:
<paramBlock2><mCloth>.getObjectParamBlock <node>nodeReturns the ParamBlock2 of the mCloth applied to the specified node.
<paramBlock2><mCloth>.getGroupParamBlock <string>groupnameReturns the ParamBlock2 of the specified named Point Group.
<integer><mCloth>.numberVertices <node>nodeReturns the vertex count of the node the mCloth is applied to.
<void><mCloth>.selectVertices <bitArray>sel <node>nodeSets the vertex selection to the bitarray specified by the first argument. The second argument is the node the mCloth is applied to.
<bitArray><mCloth>.getSelectedVertices <node>nodeReturns the vertex selection as a bitarray. The argument is the node the mCloth is applied to.
<integer><mCloth>.makePointGroup <bitArray>vertex_sel <node>node <string>nameCreates a Point Group from the specified vertex selection in the given node and assigns it the name specified by the third argument.
<void><mCloth>.makeConstraint <string>groupname <string>type <node>target_nodeCreates a Constraint from the specified group of the given type using the given node.
<void><mCloth>.initPointgroup <string>groupnameInitializes the named Point Group.
<void><mCloth>.detachPointgroup <string>groupnameDetaches the named Point Group.
<void><mCloth>.deletePointgroup <string>groupnameDeletes the named Point Group.
<void><mCloth>.makeGroupConstraint <string>groupname <string>target_groupConstrains the group specified by name in the first argument to the target group specified by name in the second argument.
<void><mCloth>.simulate <boolean>show_dialogSimulates the mCloth. The boolean argument controls whether the simulation dialog should be shown or not.
<void><mCloth>.simulateLocal <integer>stop_condition <float>param <boolean>dampedPerforms a local simulation with the stop condition specified by the first argument.
<void><mCloth>.stopLocalSimulation()Stops the local simulation.
<void><mCloth>.eraseSimulation()Erases the simulation data.
<void><mCloth>.truncateSimulation()Truncates the simulation.
<void><mCloth>.setInitialState <node>nodeSets the node's Initial State.
<void><mCloth>.resetState <node>nodeResets the node's state.
<void><mCloth>.grabState <node>node<void><mCloth>.delObjectCache <node>nodeDeletes the object cache of the specified node.
<void><mCloth>.exportCache <node>node <string>filenameExports the cache of the specified node to the file provided by the second argument.
<void><mCloth>.importCache <node>node <string>filenameImports the cache specified by the second argument into the node given by the first argument.
<void><mCloth>.loadCache <node>nodeLoads the cache of the specified node.
<void><mCloth>.loadAllCaches()Loads all caches.
<void><mCloth>.saveCache <node>nodeSaves the cache of the specified node.
<void><mCloth>.saveExtraCache <node>nodeSaves the extra cache of the specified node.
<void><mCloth>.saveAllCaches()Saves the caches of all nodes.
<void><mCloth>.saveAllExtraCaches()Saves the extra caches of all nodes.
<value><mCloth>.getObjectProperty <node>node <string>propertyReturns the given node's property value. The second argument specifies the property name as string.
<void><mCloth>.createKeys()Bakes the simulation to keys.
<void><mCloth>.setObjectType <node>node <integer>type <boolean>updateSimSet the Object Type of the specified node to the integer passed as second argument. If the third argument is True, the simulation will be updated.
<integer><mCloth>.getObjectType <node>nodeGet the Object Type as Integer.
<void><mCloth>.setObjectProperty <node>node <string>property <value>valueSet the Object Property with name specified by the second argument in the node given by the first argument to the value provided by the third argument.
<TSTR array><mCloth>.showObjectProperties()Show the Object Properties of the specified node.
<void><mCloth>.addForceField <node>nodeAdd Force Field to the specified node.
<void><mCloth>.removeForceField <node>nodeRemove Force Field from the specified node.
<void><mCloth>.flagParticles <bitArray>selFlag the particles specified by the vertex selection bitarray.
<integer><mCloth>.makeTear <bitArray>vertex_sel <node>node <string>nameCreate a Tear using the specified vertex selection bitarray in the node given by the second argument and name the tear using the third argument.
<void><mCloth>.clearTears <node>nodeClear the Tears definitions in the specified node.