Dynamics
The dynamics feature integrates a physics solver to help animators quickly achieve believable motion with minimal input. It is a great way to get automatic animation of secondary elements such as tails and antenas.
It is represented by a layer working just like other rumba layers which means that you can animate before (i.e. main character motion) and after it (i.e. polishing).
The simulation is deterministic which means that with the same inputs, you will always get the same results.
Getting started
The first step is to create a dynamics layer, you can find it in the Layers menu. Each dynamics layer has its own independent physics solver. You can create dynamic objects by using the + button directly on the layer. Gizmos representing dynamics objects such as collision volumes will be shown in the viewport by default, you can hide them by clicking on the Show Gizmos button on the layer.
Do not forget to check if the scene_units plug of your Document is set to a coherent value with respect to your content because it has a big influence on the behavior of the physics simulation.
Dynamics nodes
Rumba comes with a selection of pre-made dynamic nodes which fullfill common needs.
Dynamic Body
This can animate any controller as a rigid body responding to gravity, collision, etc… This is useful to model falling or stacked objects for example.
To create dynamic bodies, select any number of controllers, open the + menu on your dynamics layer and click on the Create Dynamic Body button.
Parameters to look out for would be density which will impact the mass of the body, Enable Collisions to chose whether to include the body in collision resolution or not and Max Linear/Angular Velocity and Linear/Angular damping to put a cap on speed which can be necessary in situations where the body could get a lot of force over a short period, when colliding with a moving kinematic body for instance.
Kinematic Body
A kinematic body follows the controller it is attached to as if moved by an infinite force. It is typically used to make something collidable without itself being affected by collisions. It can be used to represent walls, floors and other immovable objects you want to collide with, or moving objects that should push things around like a character passing through rubble or a hand that wipes a table clean.
A kinematic body is pretty straightforward to setup, the most crucial aspect being the shape of the collision body.
Anchored Body
An anchored body is a rigid body that is attached to a controller by a joint. Common use cases are hinge mounted objects such as flaps or doors. You can also use the joint drives to give the relationship a springy behavior.
For a hinge-like setup, the important parameters are the joint local pose which will act as the pivot point, and the mass center to give it a realistic swing. For a spring you will have to play with the Angular and Linear Drive Stiffness/Damping.
In both cases, think about which axes you want to free with joint motions, this is often the first step as by default the anchored body starts with all axes locked.
Articulation
This can turn any chain of FK controllers into a physics enabled articulation. It is useful to animate ropes, chains, tails and the like.
To create an articulation, select each controller in your FK chain in order, open the + menu on your dynamics layer and click on Create Articulation. You can also extend an existing articulation by starting your selection from a controller that is already part of an articulation.
Rumba will attempt to find a good starting point with regards to the shape of the links in the chain but you should probably review them and adjust them to the geometry, most notably if you want to enable collisions.
The most important properties of articulation links to get started are Angular Drive Stiffness and Angular Drive Damping. Higher stiffness will intensify the springy behavior of the joint, making it follow motion more agressively. Higher damping will slow joints down making it a good way to tame a misbehaving articulation.
Wind
Applies a force to all dynamic objects in the layer. The wind is subject to a turbulence field that you can tweak to match your intent.
The average direction of the wind is the Z axis of the gizmo. Rotate it around to change the way the wind blows.
Joint
In the context of dynamics, a joint links two bodies together and offers guarantees about their relative position and rotation dynamicaly. Typically, joints are used to put limits on rotation and translation on some axes to represent two objects being bound together by a string or a hinge for example.
Joints can also apply forces to the bounded objects, these forces are applied by devices called drives. The linear drive applies translational forces and the angular drive applies rotational forces. Drives apply two kinds of forces to the body: - Stiffness which drives the body to the target position or rotation of the joint. - Damping which drives the body to a target velocity, typically zero, to stabilize the system. Together, these forces can be used to create more complex relationships with spring-like behaviors.
We refer to the actors bound by a joint as actor0 and actor1. The joint node has two children, LocalPose0 and LocalPose1 that represent the joint anchor point in each actor’s frame. When two bodies are bound, you can use LocalPose to adjust the way they are bound together. If you create a joint from a single body, it will be set to actor1 and actor0 will be left unconnected. This is a useful pattern with PhysX, in that case, LocalPose0 can act as an attractor for your body, and you can for example use the linear stiffness of the joint to lead/drag it in the direction you want, as is illustrated in the above video.
Properties
All dynamic nodes share some basic properties which can be overwhelming when first encountered. Here is a reference to them along with some tips on how to best tune them.
Layer
- Gravity
Controls whether gravity is enabled scene-wide.
- Gravity Acceleration
The acceleration applied to all gravity affected actors (in m/s)
- Substeps
The number of simulation runs per frame. If your simulation breaks, you may try to increase the number of substeps at the cost of simulation time.
- Scale
A global linear scale factor for the simulation. Increasing this value enlarges the simulated scene. It is recommended to adjust the document’s scene_units attribute first.
Shape
Represents the size and shape of the collision volume.
- Kind
Can be one of Sphere, Box or Capsule.
- Radius
Used by Sphere and Capsule.
- Half Width
Used by Box.
- Half Height
Used by Box and Capsule.
- Half Depth
Used by Box.
Rigid Body
Represents a dynamic rigid body object.
- Density
The density of the body is factored with its volume to determine its mass. A higher value will give more inertia to the body.
- Linear Damping
The linear damping coefficient. Controls how much the body resists translation.
- Angular Damping
The angular damping coefficient. Controls how much the body resists rotation.
- Max Linear Velocity
The maximum translation speed for this body. Higher velocities are clamped to this value.
- Max Angular Velocity
The maximum rotation speed for this body. Higher velocities are clamped to this value.
- Restitution
The restitution coefficient represents the ratio of speeds after and before an impact. Another way to put it would be to call it a bounciness coefficient.
- Enable Collisions
Controls whether or not this body takes part in collision detection.
- Disable Gravity
All rigid bodies are affected by gravity by default. This flag disables it for this body.
Joint
Links two bodies together.
- Drive Target
The drive goal position. It is the target that the angular and linear drives will try to reach.
- Linear/Angular Drive Stiffness
The spring strength of the drive to reach the target position/rotation, proportional to the position/rotation difference. Can be seen as a driving force.
- Linear/Angular Drive Damping
The spring strength of the drive to reach the target linear/angular velocity (typically zero), proportional to the linear/angular velocity difference. Can be seen as a restraining force.
- Linear/Angular Drive Max Force
The maximum force that can be exerted by the drive.
- Translate X/Y/Z Motion
Controls whether each axis is either :
- Locked
The axis is completely locked, no translation will happen along this axis.
- Limited
The axis is limited between Translate X/Y/Z High/Low Limit.
- Free
The axis can be translated along freely.
- Twist/Swing1/Swing2 Motion
Corresponds to X/Y/Z rotation axes. Controls whether each axis is either :
- Locked
The axis is completely locked, no rotation will happen around this axis.
- Limited
The axis is limited between Twist/Swing1/Swing2 High/Low Limit.
- Free
The axis can be rotated around freely.