This command sets the attributes for the rigid solver In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
autoTolerances (at) | bool | ||
Turns the auto tolerance calculation on and off. The auto tolerances calculation will override the default or user defined values of the step size and collision tolerance value that is calculated based on the objects in the scene. Default: 0 (off) |
|||
bounciness (b) | bool | ||
|
|||
cacheData (cd) | bool | ||
|
|||
collide (c) | bool | ||
|
|||
collisionTolerance (ct) | float | ||
|
|||
contactData (ctd) | bool | ||
|
|||
create (cr) | bool | ||
|
|||
current (cu) | bool | ||
|
|||
deleteCache (deleteCache) | bool | ||
|
|||
displayCenterOfMass (dcm) | bool | ||
|
|||
displayConstraint (dc) | bool | ||
|
|||
displayVelocity (dv) | bool | ||
|
|||
dynamics (d) | bool | ||
|
|||
friction (f) | bool | ||
|
|||
interpenetrate (i) | bool | ||
|
|||
interpenetrationCheck (ic) | bool | ||
|
|||
name (n) | unicode | ||
rigidBodies (rb) | bool | ||
|
|||
rigidBodyCount (rbc) | bool | ||
|
|||
showCollision (sc) | bool | ||
|
|||
showInterpenetration (si) | bool | ||
|
|||
solverMethod (sm) | int | ||
Sets the solver method. The choices are 0 | 1 | 2. 0 = Euler (fastest/least acurate), 1 = Runge-Kutta ( slower/more acurate), 2 = adaptive Runge-Kutta (slowest/most acurate). The default is 2 (adaptive Runge-Kutta) |
|||
startTime (stt) | float | ||
|
|||
state (st) | bool | ||
|
|||
statistics (sta) | bool | ||
|
|||
stepSize (s) | float | ||
|
|||
velocityVectorScale (vs) | float | ||
|
Derived from mel command maya.cmds.rigidSolver
Example:
import pymel.core as pm
import maya.cmds as cmds
# Set the playback time range to [1, 100]
pm.playbackOptions(min=1, max=100)
# Result: 1.0 #
# Create a poly cube named "floor"
pm.polyCube(w=10, h=0.10, d=10, sx=10, sy=1, sz=10, ax=(0, 1, 0), name='floor')
# Result: [nt.Transform(u'floor'), nt.PolyCube(u'polyCube1')] #
# Create a poly sphere named "ball", then move it to 0 9 0
pm.polySphere(r=1, sx=20, sy=20, ax=(0, 1, 0), name='ball')
# Result: [nt.Transform(u'ball'), nt.PolySphere(u'polySphere1')] #
pm.move(0, 9.0, 0, r=True)
# Create a new rigid body solver
pm.rigidSolver(create=True, name='rigidSolver1')
# Result: nt.RigidSolver(u'rigidSolver1') #
# Set the floor to passive rigid body
pm.select('floor')
pm.rigidBody(passive=True, solver='rigidSolver1', name='passiveRigidBody')
# Result: nt.RigidBody(u'passiveRigidBody') #
# Set the ball to active rigid body
pm.select('ball')
pm.rigidBody(active=True, solver='rigidSolver1', name='activeRigidBody')
# Result: nt.RigidBody(u'activeRigidBody') #
# Add a gravity field, and connect it to ball
pm.gravity(pos=(0, 0, 0), m=9.8, dx=0, dy=-1, dz=0, name='gravityField')
# Result: nt.GravityField(u'gravityField') #
pm.connectDynamic('activeRigidBody', f='gravityField')
# Result: [u'activeRigidBody'] #
# Play
pm.play(w=True)
# Set the rigid solver to allow the ball to interpenetrate the floor, then replay
pm.currentTime(1, e=True)
# Result: 1.0 #
pm.rigidSolver('passiveRigidBody', 'activeRigidBody', 'rigidSolver1', e=True, interpenetrate=True)
# Result: nt.RigidSolver(u'rigidSolver1') #
pm.play(w=True)
# Set the rigid solver to disallow the ball to interpenetrate the floor, replay
pm.currentTime(1, e=True)
# Result: 1.0 #
pm.rigidSolver('passiveRigidBody', 'activeRigidBody', 'rigidSolver1', e=True, collide=True)
# Result: nt.RigidSolver(u'rigidSolver1') #
pm.play(w=True)
# Set the rigid solver to turn off the bounciness, replay
pm.currentTime(1, e=True)
# Result: 1.0 #
pm.rigidSolver('rigidSolver1', e=True, bounciness=False)
# Result: nt.RigidSolver(u'rigidSolver1') #
pm.play(w=True)