Paint Effects
syllabus | schedule | projects | class notes | resources | students | Digital Arts website
Rigid Bodies

Rigid Body Dynamics

They collide rather than pass through other geometry
Two kinds: Passive and Active

Active - reacts to dynamics (fields, collisions and springs) - can't set Keyframes on them

Passive - can have active rigid bodies collide with it - dynamics have no effect on it, can key them

Example: A bouncing Ball would be Active with a gravity field and collision set on it
The floor the ball bounces on would be Passive

Rules:
Only 1 rigid body per object
Curves can't be a rigid body
Only the side with the normals outward can be collided with
Don't animate the scale or deformation of rigid bodies
Use Dynamic Relationship Editor to connect them
Delete construction History before making it a Rigid Body

To Make a rigid body:
Select the Object
Soft/Rigid Bodies -> Create Active (or Passive) Rigid Body

Exercise:

Make a sphere, torus and cone into Active Rigid Bodies and a plane into a Passive Rigid Body.
Make sure all the objects are above the plane.
Tilt the torus and cone and have them at different levels above the plane.
Apply gravity to the objects.
Rewind and play.

Variations:
Give the plane lumps and attach gravity fields with different magnitudes to the active rigid bodies.

To Make a Rigid Body from several objects:
Group the objects under a parent and then select the parent or group in the Outliner
Soft/Rigid Bodies -> Create Active or Passive Rigid Body

Exercise:

Make a table.
Use curves and revolve to make the legs (refer to rules above on what you must do before proceeding.)
Group it and tilt it then make it an active rigid body.

To Delete a Rigid Body

Select the Rigid Body
Edit -> Delete by Type -> Rigid Bodies

Options in the Attribute Editor

Select the rigid body first or select options before making the rigid body.

To Select the Rigid Body
Select the X shaped icon OR in the Outliner - Display Menu - Shapes = ON
In Outliner click the + to open the surface and select the Rigid Body icon (bowling pins)

Attribute Editor Options:

Name: name the body
Active: ON = Active; OFF=Passive
Particle Collision: if the particles collide with the active rigid body and you want the object to react to the collision
Allow Disconnect: by default you are not allowed to break a connection to the rigidBody solver - you can break the connection to the Rigid Body Solver if you turn Allow Disconnect ON but this could cause problems
Mass: the greater the mass, the greater the influence on objects it collides with (only for Active)
Center of Mass: position is indicated by an X (look in wireframe) effects how it bounces and rotates
only applies to active rigid objects
Lock Center of Mass: when you alter the surface of an active rigid body, it recalculates the center, this prevents it from doing that when checked.
Static Friction: effects how an object will begin moving 0=free movement 1=less movement
Dynamic Friction: moving body will resist movement against other objects 0=free movement 1=less
Bounciness: Resilience
Damping: It is like drag - puts an opposing force on the movement of the object - effects motion before, during and after contact with other objects
Positive Numbers = less motion Negative Numbers = increase motion
Impulse: Instant Force on the rigid body - can key the impulse - set the tangents to stepped
Impulse Position: where the force will hit
Spin Impulse: rotates the object

Initial Settings:
Initial Spin, Position, Orientation and Velocity

Performance Attributes:
Stand in geometry - speeds up the calculations - always use this to do inital testing then change to none to do the calculation on the actual geometry for the final
Apply Foces At: Center of Mass, Bounding Box (eight corners), Vertices or CVs (slowest)

Tessellation Factor
For jagged geometry you may need to increase this to help it detect where the collissions should be detected but it will slow down the calculations.

Collision Layer
You can put a number of objects in a collision layer together and they will only effect other objects in that layer. You can set up different layers. Objects in Layer 1 will react to all objects in any layer.

Collisions
ON = collisions and OFF = it is not effected by collisions

Ignore
OFF = ignore fields, collisions, and other rigid body effects.

Rigid Body Solver Tab - the equations used to calculate the dynamics - can be changed
One solver figures out the dynamics for all - can make more than one solver if needed

Step Size = how often during a frame, the calculations occur - lower to improve accuracy - slow
Collision Tolerance - how quickly it detects collisions - decrease number to improve the accuracy of the collision but it be slow (used for thin geometry)
Scale Velocity scales the displayed arrow for velocity
Start Time: frame it starts on.
Current Time: slows down the entire simulation or speeds it up.

Solver Method
Midpoint - Calculates faster with less accuracy.
Runge-Kutta - Calculates at medium speed and accuracy.
Runge-Kutta Adaptive - Calculates slower but with most accuracy.
State
Turns off or on the effect of fields, collisions, and rigid body constraints for the rigid bodies it controls. If you want to speed up playback of your animation and temporarily are not concerned with rigid body effects, turn off the State.
Friction - Sets whether the rigid bodies stick or slide after collision. If Friction is on, the rigid bodies stick; if Friction is off, they slide.

Bounciness - Turns bounciness on or off. When off, objects won't bounce against each other, but rigid body animation plays faster.
Contact Motion - When on, Maya simulates Newtonian physics for its rigid body dynamics. When off collision forces such as Bounciness and Friction do not affect the rigid bodies. Fields affect the rigid bodies, but not initial spin, initial velocity, or impulses.
Allow Disconnect - can break connection (don't do it)
Cache Data - If you turn this on, Maya caches in memory the dynamic state of all rigid bodies connected to this solver. Can scrub in the Time Slider or play in reverse.
Delete Cache - Deletes the cached dynamic state of all rigid bodies connected to this solver.

Rigid Body Display Options:
Display Constraint - Displays icons for rigid body constraints.
Display Center of Mass
Display Velocity - Displays arrow icons indicate the velocity magnitude and direction of rigid bodies.
Display Label - Labels rigid bodies as active or passive. Also shows the type of constraint.

Ball/Cone Exercise: Make a sphere and four cones and two planes perpendicular to each other. Make the sphere and cones active rigid bodies and make the planes passive. Parameters on the ball:
InitialVelocity (experiment with numbers between 20 and 100, negative and positive)
InitialSpin = (experiment with numbers between 500 and 2000, negative and positive)
Mass = ? experiment
Bounciness = 0
Damping = 0
ApplyForces at = verticesOrCVs
standin = sphere

The Cones:
mass = ? experiment
bounciness = 0.5
damping = 0
apply forcesAt = verticesOrCVs
static friction to 0.05
dynamic friction = 0.05

Turn on the dynamic labels by going to the Attribute Editor - rigidSolver - displayLabel = ON
Apply gravity to the ball and cones
Play it and change the attributes to fine tune the animation.

Cache the animation in memory
Set your timeline to the length of the animation
Select the sphere and in the rigidSolver set cacheData = ON
Rewind and play to cache. (If you want to change the animation, delete the cache, make the changes then re-cache it.).

Baking the simulation
Select the Active Rigid Bodies or the group with the rigid bodies
Edit - Keys - Bake Simulation Options
Pick Hierarchy: Selected
Pick From Channels Box (to only bake the attributes you want)
Set the time range and sample by (experiment with sample by - will set keys closer or further apart)
Select the channels you want to bake in the Channel Box
Bake
Go to the Graph Editor and select the curves in the left channel and Curves - Simplify the Curve
Remove the rigid body from the active object

Creating Separate Rigid Body Solvers
(used when you have separate interactions happening)

Solvers - Create Rigid Body Solver
it is called rigidSolver1 (or 2, etc)

Selecting the solver:
Solvers - Current Rigid Solver - rigidSolver1

When you create a rigid body (active or passive) it will use the solver that is selected

To move a rigid body to a different solver:
Select the rigid body
In the script editor:
rigidBody -edit -solver solvername (change solvername to rigidSolver1 or 2, etc.)

Exercise:

1. Create a house of cards or a set of dominoes and have a marble roll in and knock it down.

2. A balloon and a bowling ball each fall down a flight stairs and knock over blocks along the way.

3. Create an animation and have the passive body moving and the active objects have initial spins and velocity set on them.

4. Create 2 separate solvers with two different sets of rigid body objects (these won't interact with each other).