This package contains the MayaBullet package for Maya. The goal of this project is to provide deep integration between the Bullet physics engine and Maya for authoring content for use either within Maya (e.g. film and pre-rendered visualization) or for use with external software that uses the Bullet runtime engine (e.g. games and real-time simulations).
This guide is organized into the following sections:
This document assumes the reader is familiar with the Bullet Physics engine. To learn more about Bullet, please refer to Bullet Physics Manual, which can be found on www.bulletphysics.com.
NOTE: MayaBullet is a work in progress. It may contain bugs, and scene compatibility between releases is not guaranteed.
The main features of the current release include:
The sections below explain how to use these features.
When you add Bullet objects to a Maya scene, a special bulletSolverShape node is added. This node has attributes that manage the overall Bullet physics settings that apply to the entire scene, such as gravity and wind, and the solver engine that is used (CPU, GPU).
Bullet Solver attributes:
The Bullet physics simulation is driven by the Maya animation time line, so to run a simulation, you simply play the animation from the first frame. To increase the duration of the simulation, increase the length of the timeline.
MayaBullet also provides an Interactive Playback mode. Normally during animation playback, you cannot manipulate objects in the Maya scene. However, by using the Bullet-> Interactive Playback option, you can move scene objects such as rigid bodies in the scene, and see them interact with the Bullet physics simulation.
To create a new rigid body:
When you create a new rigid body, a rigid body node and a transform node (with the _Init suffix) will be added to the scene. You may parent objects in the Maya scene to the rigid body to have them move along with the rigid body during the physics simulation. To change the rigid body's initial position (i.e. its position when the physic simulation starts), modify the parent (_Init) transform.
New rigid bodies are by default created as kinematic rigid bodies with a box collider. To change the type of rigid body, edit the Body Type attribute in the RigidBody Properties section of the rigid body shape node. You can also change the defaults used when new creating new rigid bodies by clicking on the option box to the right of the Bullet menu entry.
Bullet supports three types of rigid bodies:
The additional physics attributes in the RigidBody Properties section are used to determine the behaviour of dynamic rigid bodies in the physics simulation. Consult the Bullet Physics Manual for details about how they affect the simulation. Two attributes that deserve special attention are:
The Initial Conditions section contains attributes that are applied when the Bullet physics solver starts simulating.
The Forces/Impulses section contains attributes that control impulses applied to the rigid body every frame. Note that you will often want to animate these values so that they return to zero, because in the absence of any counter-acting forces, continuously applying impulses over an entire animation will cause the rigid body to accelerate to greater and greater velocities.
In addition to the RigidBody Properties, the rigid body shape has attributes for the Collider Properties. These attributes specify how the shape of the rigid body is represented in the physics simulation. Generally speaking, simpler shapes perform better and are more stable and predictable. The simplest shapes are plane (infinite), box, sphere, cylinder and capsule. Their shape is determined by the following attributes:
Note that the plane collider represents an infinite plane that passes through the position of the object's transform, and is oriented according to its rotation. It extends forever in the local X and Z directions.
To create rigid bodies with more complex colliders, you will need to use the Create Rigid Body (from Mesh) option from the Bullet menu:
Alternatively, if you already have a rigid body and would like to connect a mesh to it to use as a collider, use the Connect Mesh to Rigid Body (as Collider) option from the Bullet menu:
As with the previous rigid body creation menu item, the default values for new rigid bodies with mesh colliders can be customized using the option box to the right of the menu item.
Once you have created a rigid body with a mesh collider, you can use the following collider shape types:
Please consult the Bullet Physics Manual for more information about the tradeoffs between the different collider shape types.
To create a rigid body constraint:
The rigid body constraints currently supported include Point, Hinge, Slider, Cone-Twist, and the generic 6 Degree-of-Freedom. The behaviour of the different constraint types is documented in the Bullet Physics Manual.
The Constraint Properties section contains attributes that determine how the constraint is applied, for example how freely the rigid bodies will swing or slide. "Linear" attributes control the distance between the constraint point and the rigid bodies. "Angular" attributes control the rotation of the rigid bodies around the constraint point.
The Limits section contains attributes for setting limits on the constraint's range of motion. The various constraint types support different combinations of limits. In general, linear constraints control the distance of the rigid bodies from the constraint point, i.e. sliding motions. Angular constraints control the freedom for rigid bodies to rotate around the constraint point, i.e. twisting and swinging motions.
The Limit Properties section contains attributes that determine how the rigid bodies will move when they reach a limit, e.g. whether they stop abruptly or gently at the limit.
The Motors section contains attributes for actively driving the constraint. Normally, rigid bodies attached to a constraint will move freely until they come to rest. With motors, the constraints will actively move the rigid bodies. The hinge and 6-DOF constraints support angular motors, which will rotate the rigid body around the constraint. The slider constraint supports linear motors, which will push or pull the rigid body.
To create a soft body:
Bullet soft bodies can be created from Maya's polygon meshes. When a soft body is created, a new "solved" mesh is created (with the _Solved suffix added to the name of the original mesh), which will be deformed by the Bullet soft body simulation. Polygon planes are good for use as cloth soft bodies, although any polygon mesh can be used.
The SoftBody Construction section contains attributes that affect how the soft body is created.
The SoftBody Properties section contains attributes that affect how the soft body behaves when simulated by the solver.
The Aerodymamics section contains attributes that affect how the soft body reacts to the air around it.
The Pose Matching section contains attributes for the soft body pose matching system, which works on closed shapes. Any combination of shape and volume matching may be used on a single soft body. Shape matching causes the soft body to try to maintain its original shape. Higher shape coefficients will cause the body to more strictly enforce its shape. Note that this can cause the soft body to penetrate or even fall through other objects. Volume matching causes the soft body to try to maintain its initial volume, and higher volume coefficients will increase the strength of this effect. Too high a volume coefficient can cause the soft body to become unstable.
The Contacts section contains attributes that determine how strictly the solver will try to maintain the soft body's shape when it comes in contact with various types of objects.
The SoftBody Solver section contains attributes that the Bullet solver uses to modify how it updates the soft body system.
To create a soft body anchor:
The vertex will now be anchored to the rigid body. This rigid body can be animated, or even simulated by Bullet, and it will affect the soft body.
MayaBullet provides the ability to paint per-vertex properties onto a soft-body. Currently you can paint the mass property. Setting the mass to zero has the special effect of locking the vertex in place. To paint mass values on the vertices of a soft body:
This activates the standard Maya Paint Attributes tool, allowing you to use all of the painting modes and options it provides. If the Paint Attributes settings are not initially visible, from the Window menu, choose: Window-> Settings/Preferences-> Tool Settings. To see the weights in the viewport, you will also need to select the smooth shaded or wireframe over shaded view mode from the options along the top of the viewport.
To streamline "pinning" vertices on a soft body by setting their mass to 0, you can also use the Set SoftBody Vertex Properties option:
MayaBullet provides two tools to assist with setting up characters and other assets based on skeletons (joint hierarchies).
To add kinematic rigid bodies to a skeleton, use Bullet->Add Colliders to Skeleton. This tool examines the joint hierarchy starting from the currently selected joint, and creates a capsule around each bone. These capsules will following the animation of the skeleton, and collide with dynamic physics objects. Note that physics objects will not affect the animation, the interaction is strictly one-way.
The capsule generation process can be customized using the option box parameters accessed to the right of the menu item.
To create a dynamic ragdoll from a skeleton, select a joint as the root of the skeleton, and use Bullet->Create Ragdoll from Skeleton. The tool will create a network of dynamic rigid body capsules that correspond to the bones of the skeleton, and connect them with constraints that match the attributes of the joints. The names of the capsules and constraints are based on the names of the joints in the skeleton, to assist tools developers in writing exporters or rigging scripts to combine the ragdoll motion with standard skeletal animations.
The option box parameters for creating ragdolls can be customized in the same way as the Add Colliders to Skeleton tool. In addition to capsule parameters, there are parameters for configuring the constraints. The Joint Name Separator can be changed to modify the character(s) that appear between joint names when naming capsules.
Workaround: Use the source mesh to explicitly set particleMass.
Workaround: Go to the start frame.