移動先: 概要 戻り値 関連項目. フラグ. Python 例.
rigidSolver([autoTolerances=boolean], [bounciness=boolean], [cacheData=boolean], [collide=boolean], [collisionTolerance=float], [contactData=boolean], [create=boolean], [current=boolean], [deleteCache=boolean], [displayCenterOfMass=boolean], [displayConstraint=boolean], [displayVelocity=boolean], [dynamics=boolean], [friction=boolean], [interpenetrate=boolean], [interpenetrationCheck=boolean], [rigidBodies=boolean], [rigidBodyCount=boolean], [showCollision=boolean], [showInterpenetration=boolean], [solverMethod=int], [startTime=float], [state=boolean], [statistics=boolean], [stepSize=float], [velocityVectorScale=float])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
rigidSolver は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
リジッド ソルバのアトリビュートを設定します。
なし
戻り値の型は照会モードでは照会フラグが基になります。
constrain, rigidBody
autoTolerances, bounciness, cacheData, collide, collisionTolerance, contactData, create, current, deleteCache, displayCenterOfMass, displayConstraint, displayVelocity, dynamics, friction, interpenetrate, interpenetrationCheck, rigidBodies, rigidBodyCount, showCollision, showInterpenetration, solverMethod, startTime, state, statistics, stepSize, velocityVectorScale
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# Set the playback time range to [1, 100]
cmds.playbackOptions(min=1, max=100)
# Create a poly cube named "floor"
cmds.polyCube(w=10, h=0.10, d=10, sx=10, sy=1, sz=10, ax=(0, 1, 0), name='floor')
# Create a poly sphere named "ball", then move it to 0 9 0
cmds.polySphere(r=1, sx=20, sy=20, ax=(0, 1, 0), name='ball')
cmds.move(0, 9.0, 0, r=True)
# Create a new rigid body solver
cmds.rigidSolver(create=True, name='rigidSolver1')
# Set the floor to passive rigid body
cmds.select('floor')
cmds.rigidBody(passive=True, solver='rigidSolver1', name='passiveRigidBody')
# Set the ball to active rigid body
cmds.select('ball')
cmds.rigidBody(active=True, solver='rigidSolver1', name='activeRigidBody')
# Add a gravity field, and connect it to ball
cmds.gravity(pos=(0, 0, 0), m=9.8, dx=0, dy=-1, dz=0, name='gravityField')
cmds.connectDynamic('activeRigidBody', f='gravityField')
# Play
cmds.play(w=True)
# Set the rigid solver to allow the ball to interpenetrate the floor, then replay
cmds.currentTime(1, e=True)
cmds.rigidSolver('passiveRigidBody', 'activeRigidBody', 'rigidSolver1', e=True, interpenetrate=True)
cmds.play(w=True)
# Set the rigid solver to disallow the ball to interpenetrate the floor, replay
cmds.currentTime(1, e=True)
cmds.rigidSolver('passiveRigidBody', 'activeRigidBody', 'rigidSolver1', e=True, collide=True)
cmds.play(w=True)
# Set the rigid solver to turn off the bounciness, replay
cmds.currentTime(1, e=True)
cmds.rigidSolver('rigidSolver1', e=True, bounciness=False)
cmds.play(w=True)