pymel.core.effects.rigidBody

rigidBody(*args, **kwargs)

This command creates a rigid body from a polygonal or nurbs surface.

Flags:
Long name (short name) Argument Types Properties
active (act) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Creates a rigid body that is active. An active rigid body accepts and causes collisions and is effected by dynamic fields. This is the default.
angularVelocity (av) bool ../../../_images/query.gif
 
Current angular velocity of rigid body.
applyForceAt (afa) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Determines how forces are applied to the rigid body. The choices are centerOfMass | boundingBox | verticesOrCVs. Default: boundingBox
bounciness (b) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the restitution (or bounciness) of the rigid body. Range: 0.0 - 2.0 Default: 0.6
cache (c) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Turns caching on (1) or off (0) for the rigid body. Default: off
centerOfMass (com) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the center of mass (x,y,z) of the rigid body. Default: actual center of mass.
collisions (cl) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Truns collisions on/off for the rigid body. If the collisions are turned of the rigid body will not collide with any other rigid body. Default: on.
contactCount (cc) bool ../../../_images/query.gif
 
returns the current contact count for the rigid body.
contactName (cn) bool ../../../_images/query.gif
 

returns all the rigid body names which are in contact with this shape. One name for each contact will be returned.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

contactPosition (cp) bool ../../../_images/query.gif
 
returns all the contact position. One position for each contact will be returned.
damping (dp) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the damping value of the rigid body. Range: -2.0 - 2.0 Default: 0.0
deleteCache (dc) bool ../../../_images/edit.gif
 
Deletes the cache (if one exists) of the rigid body.
dynamicFriction (df) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the dynamic friction for the rigid body. Range: 0.0 - 1.0 Default: 0.2
force (f) bool ../../../_images/query.gif
 
Current force on the rigid body.
ignore (ig) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Causes the rigid body to be ignored in the rigid solver. Default: off
impulse (i) float, float, float ../../../_images/create.gif ../../../_images/edit.gif
 
Applies an impulse (instantaneous) force on a rigid body. Default: 0.0 0.0 0.0
impulsePosition (imp) float, float, float ../../../_images/create.gif ../../../_images/edit.gif
 
The position at which the impulse is applied. Default: the bodies center of mass.
| .. |
iav)** | float, float, float | .. image:: /images/create.gif |
| | .. image:: /images/query.gif |
| | .. image:: /images/edit.gif |
 
Sets the initial angular velocity of the rigid body. Default: 0.0 0.0 0.0
initialVelocity (iv) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the initial velocity of the rigid body. Default: 0.0 0.0 0.0
layer (l) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the collision layer of the rigid body. Only rigid bodies in the same collision layer can collide with each other. Range: = 0 Default: 0.
lockCenterOfMass (lcm) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Locks the center of mass for the rigid body. Default: off
mass (m) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the mass of the rigid body. Range: 0 Default: 1.0
name (n) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Assigns the rigid body the given name.
orientation (o) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the initial orientation (x,y,z) of the rigid body. Default: current orientation.
particleCollision (pc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Turns the ability for a rigid body to collide with particles on and off. The particles will exert a force on the rigid body. Default: off
passive (pas) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Creates a rigid body that is passive. A passive rigid body does not react to collisions but active rigid bodies can collide with it. Dynamic Fields will not effect a passive rigid body. Only passive rigid bodies can be keyframed.

position (p) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the initial position (x,y,z) of the rigid body. Default: current position.
removeShape (rs) unicode  
   
solver (slv) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

The name of the solver which this rigid node is to resided. If the solver does not exists then the rigid body will not be created. If the edit flag is thrown add the solver exists, the rigid body will be moved to that solver.

spinImpulse (si) float, float, float ../../../_images/create.gif ../../../_images/edit.gif
 
Applies an spin impulse (instantaneous rotational) force on a rigid body. Default: 0.0 0.0 0.0
standInObject (sio) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Causes the simulator to use a stand in object for the simulation. The choices are none | cube | sphere. The default is none. Default: none
staticFriction (sf) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Sets the static friction for the rigid body. Range: 0.0 - 1.0 Default: 0.2
tesselationFactor (tf) int ../../../_images/create.gif ../../../_images/query.gif
 
Sets the tesselation factor for a rigid body surface. Range: = 10 Default: 200.
velocity (vel) bool ../../../_images/query.gif
 
Current velocity of rigid body.

Derived from mel command maya.cmds.rigidBody

Example:

import pymel.core as pm

import maya.cmds as cmds

# Creates a rigid body with a initial velocity of 10 in the x
# direction, a bounciness of 0.5 and a static friction coefficent
# of 0.4.
#
pm.rigidBody( n='myRigidBody', active=True, iv=(10, 0, 0), b=0.5, sf=0.4 )

Previous topic

pymel.core.effects.resampleFluid

Next topic

pymel.core.effects.rigidSolver

Core

Core Modules

Other Modules

This Page