modo bubbble logo

Dynamics Overview


Home >> Layout & Simulation >> Dynamics Overview

back next
comment balloon Comments (1) RSS Icon
0/5 (0 votes)

What are Dynamics?

modo dynamics are essentially the evaluation of collisions between objects, these evaluations take place during what is called a Simulation. A Simulation simply put evaluates all the dynamics settings and then computes the motions automatically based on those settings, producing the final result. Simulations can provide extremely realistic object motions, and for many situations they do it in near real time. Users only need to assign attributes that control how the items react during the simulation and then press the 'Simulate' button. This action puts those settings into motion for the user to see the results directly in the 3D viewport. Users can then adjust those settings and get feedback on the changes made in near real-time. However, it takes more than just assigning an item as being dynamic, forces are also necessary to act upon those objects in order to produce any motion. If you imagine releasing a ball from your hand makes it fall and bounce, the same ball 'dropped' on the International Space Station would just stay in the position it was released. So just like in the real world, gravity is automatically applied to make things move. Of course users can also apply additional Forces (or remove them), but for many cases, gravity is all that is needed.

During a Simulations, how items move and react to any collision is based on the 'Dynamic' settings of the Item. Depending on what the user selects and applies these could make objects Soft Body surfaces that bend and fold, while others could be heavy Rigid Body bricks that simply drop in a pile when simulated. The settings for Dynamics are very flexible and allow users to simulate a variety of materials. There are even Presets that automatically adjust the Density, Bounce and Friction values. For more complex simulations additional Constraints and Forces can be applied to these Dynamic items allowing items to move relative to other object in the simulation. Once any simulation is adjusted and perfected, the results can be cached and saved with the scene for later use, or the evaluations can be baked down to keyframes for network rendering, or simply frozen in their resting state for a still frame render.

Dynamics Workflow Overview

The modo dynamics system uses the same global evaluation engine as it does for Particles, therefore a lot of the workflows can be applied to both. Due to their deep integration inside modo, they can also both work together, with dynamics affecting particles and particles affecting dynamics. This section is focused on Dynamics specifically, for more information on working with Particles, please reference the Particles Overview page of the documentation.

Dynamics, of course, first require geometry to act upon, so any simulation will need a model first. The controls for Dynamics are found in the 'Setup' interface or in the 'Dynamics' menu of the menu bar. As with all animated elements, users will be working in 'Items' selection mode. The simplest simulation can be done with a plain cube. Making sure the cube is selected, press the 'Active Rigid Body' button in the 'Dynamics' subtab of the 'Setup' toolbox. This tags the Box as dynamic, meaning it will be evaluated in a simulation, adding an additional subtab to its Properties panel with the attributes that define its actions in the simulation. Any item in the scene that is not tagged as dynamic will simply be ignored in a simulation. Making an item dynamic also adds a 'Solver' item to the scene. The 'Solver' is the item that actually evaluates all the dynamic items so is therefore required for any dynamic simulations; it also provides the ubiquitous Gravity force that makes things move as well as saves the cached values for later rendering. To actually evaluate the settings you will next need to run a 'Simulation'. There are 3 buttons below the timeline for doing so with various stopwatch icons on them-

Simulate

The first two buttons on the left will continuously run the simulations interactively, but do so in different ways, the first button will play the simulation forward from its current state based on the timeline position and continue playing it forward until the user stops it. This isn't so useful for dynamics, but its a great way to adjust the settings for Particles. The second, middle button will continually loop the full timeline range, resetting the simulation to its default state on each subsequent pass, perfect for dynamics. The great thing about these two modes is that users can adjust dynamic values interactively and see the results reflected directly in the viewport. Once the values are adjusted to your liking the third button on the right will cache the simulation values, where they will become part of the scene file, its use is covered further below.

So getting back to the dynamic Cube setup. Pressing the Simulate loop button will cause the box to fall and continue falling far out of the frame. This is because gravity continues to pull it down with nothing to stop it. So a collision object is needed. Adding a flat plane underneath the initial placement of the box and pressing the 'Passive Rigid Body' button will tag it as an item that is considered during a simulation, but not actively moving as part of it (passive!). Now pressing the same Simulate button shows the box, falling and bouncing some and coming to a stop. Thats a lot better and was pretty easy to create, all with just the default settings. If you let the simulation continue looping you will just see the box falling over and over again, but while it is playing, if you switch to the 'Properties' panel with the box selected, and then click on the 'Dynamics' subtab, you can then go in and adjust the 'Bounce' value and you'll see the box will fall differently the next time it goes down. Changing the Friction value will also show it sliding around more (or less depending on how the value changed). If you stop the simulation, you can scrub the timeline but you won't see the box move, nor will you be able to render it falling. That is done with the Compute Simulation button. Setting the time range in the dialog and pressing OK will allow you scrub the timeline and render the box falling.

That is the basic workflow when working with Dynamics, setting items as 'Active' or 'Passive' and running a simulation, adjusting values until the proper look is achieved and then caching the simulation. It is the same whether there is one box, or an entire brick wall that is meant to crash down. Of course more complex scenarios can also be created and while the setup takes additional steps, the basic workflow remains the same. The following information will also help in further understanding Dynamics and their use-

ToolboxActive vs. Passive

When working with rigid bodies, any object that doesn't deform in a simulation (like a brick or a rock) must be defined as either active or passive in order for dynamics to consider them during a simulation. The difference between an 'Active' rigid body' and a 'Passive' rigid body is that Active bodies will have their positions and rotation channels exclusively controlled by the dynamics during a simulation. Beyond the rest frame (the items initial position), users have no control over the Active object directly. Passive bodies are only considered for collision detection, any movement of the object itself is controlled by the user applying keyframes. Passive bodies are not considered by gravity, forces or falloffs, allowing users full control over the object during the course of the simulation. For simplicities sake, users can easily consider active bodies as those that dynamically move during a simulation, and passive bodies as just collision shapes (such as a ground plane or a wall).

Soft Bodies

Like its rigid body cousin, flexible, deforming elements must be tagged as a 'Soft Body' in order for Dynamics to consider it in a simulation. This allows for the simulation of fabric type surfaces. Like rigid bodies, Soft Bodies will need some type of collision or Anchor in order to not just fly away. The collision could be a bar holding up a banner, or a table setting under a tablecloth. Anchors are, like their real world counter part, attaching to specific points on the mesh, fixing them in place. Forces interact with Soft Bodies as well, so Wind can be added as well as Turbulence to add some additional realism to the Soft Body results.

Compound Rigid Bodies

Compound Rigid Bodies lets users attach a bunch of separate Item layers together and have them treated as a single Active Rigid Body. Users can also set a 'Glue' value that when exceeded by an outside force will cause parts of the compound body to break off. Selecting multiple items and then assigning the 'Compound Rigid Body' option will assign the dynamics tag to a single mesh that is connected to the Solver. The other associated meshes will all draw their Dynamics settings from the parent item with the Mass value being equally distributed between all associated layers. Setting a negative Glue value will cause the simulation to treat each Item as a separate Dynamic Body without having to make each one dynamic.

Collision Detection

Collision in Dynamics is the calculations that restrict intersections between surfaces. It is, for example, what allows a ball to bounce and roll down a stair case. Without it the solid bodies would simply pass through one another with no regard or knowledge of the opposing item. In the 'Dynamic' subtab in the Item's 'Properties' panel are the settings that control the object and how it acts. The most important setting in this tab is in regards to collision as it defines how the Dynamics computations see the object. By default modo assigns a detection type that uses the actual geometry in the item layer, but often faster (and better) results can be obtained by choosing from the additional options available, for most applications the best results are obtained using the simplest collision shape appropriate to the geometry. For example, using the cylinder collision for a wheel will produce much better results more quickly than using the hi-res geometry with tire treads and all. Collisions relating to Soft Bodies are only required when there are issues with the surface intersecting itself, this can be fixed by enabling the 'Self Collision' option.

Constraints

If Dynamics were strictly limited to only calculating collisions between objects, it would very quickly become daunting to produce even modestly complex simulations. Depending on collisions exclusively to generate the mechanics of say a rotating drive shaft for a vehicle would no doubt introduce errors and be quite costly to calculate. Constraints are essentially joints that connect two dynamic bodies together, producing much more accurate results than collision detection alone, with very little calculation overhead. Constraints come in a variety of types that cover most any type of joint users would need. Clever users will also be able to stack more than one constraint to produce even more complex effect, such as combining a Point Constraint with a Slide Constraint to produce a swinging and sliding motion, much like riding suspended from a zip-line -a ride where the participant slides down a long, taut cable suspended between two posts.

Forces

In the real world, objects are constantly subject to numerous forces that affect their motion in subtle and not-so-subtle ways; wind, gravity, friction among others. Dynamics offers a variety of forces all to produce ever more realistic physical simulations. Gravity is the chief force and is part of the Dynamics Solver item, affecting all items globally. Its default value is meant to simulate the same downward pull at full size (1:1 scale) as gravity in the real world. If a simulation isn't reacting as one might expect, it's a good bet that the scene isn't modeled to real world size, as very large items will react much differently under the same circumstances than very small items. Users can of course scale their objects, or scale the simulation to match more closely the expected result.

modo also offers six additional force types allowing users further control of the simulation. Linear, Drag, Radial, Turbulence, Vortex and Newton. These are added as Locator type item layers in the 'Items' list and, by default, affect dynamic items globally, just as the Gravity value does. Each has its particular function which is covered fully on the Forces page of the documentation.

Falloffs

Falloffs can be incredibly useful to provide additional control over Forces. Imagine flower petals drifting on the breeze, animated as Soft Body items that land inside of a box, the falloff would be used to eliminate the wind blowing inside the box, increasing the realism of the simulation. Dynamics uses the same Falloffs used for other deformers in modo. Deformation Falloffs are meant to modulate (reduce or increase) the effects of forces on dynamic items within the area of influence of the Falloff itself. Not to be confused with modo modeling falloffs; used for geometry creation and layout. Conceptually they are very similar, but instead of being applied as a function, Dynamics falloffs are added as a Locator type item to the 'Items' list where users can select them and modify their attributes and even animate them within the scene. In the items properties, users can define an attenuation range that modulates the force it is applied to.

Unlike Forces that affect items globally, Falloffs must first be attached to the Force item it is attenuating in order to produce a result. This can be done several ways. Generally, it is applied by selecting the target 'Force' item(s) prior to adding the Falloff, when using the 'Add Falloff' button in the Dynamics toolbox. When applied to a Soft Body item, users can use the 'Deformers' viewport, and select the 'Soft Body' Influence from the list; by RMB+clicking on the item to open the context menu, users can select the 'Add Override' option and select one of the Falloffs, automatically assigning it to the Soft Body. Additionally, users can use the 'Schematic' viewport to connect the two; dragging both items into the viewport (via drag and drop) and connecting the output of the Falloff item to the input of the Force item. For more information on using the Schematic Editor, please reference that page of the documentation.

Make Anchors

The 'Make Anchors' options is used to connect Soft Body items to Rigid Body items. For simulations sake, the 'Rigid Body' item needs to be Passive. The 'Anchor' option could be useful to connect a flag to a flagpole. In order for the Anchor option to work, user must follow this specific workflow- First in 'Items' mode, users need to select the target Soft Body item AND the target Passive Rigid Body item. With the items selected, change into the 'Vertices' mode (press '1' on the keyboard) and select at least one vertex on the Soft Body item, and at least one more on the Rigid Body (selection order isn't important). With the vertices selected, press the 'Make Anchors' option in the Dynamics toolbox. The two items are now rigidly connected together via an additional 'Anchor' item added to the 'Soft Body'. To break the connection, simply delete the resulting 'Anchor' item, to make adjustments, remove the Anchor and recreate it, following the above instructions.

Caching Simulations

Using the command "Dynamics > Cache Simulation..." or pressing the cache interface button opens the 'Compute Simulation' dialog-

Compute

Here you can define the simulation frame range and press OK, this will cache the simulation, what that does is fixes the simulation value, making them part of the scene. This is the only way to view simulated elements when scrubbing the timeline. It is also the only way to render the simulation results. Keep in mind that in complex simulations, files size can increase a lot when caching the dynamics.

 

Additional Dynamics Considerations

Items vs. Components

Animation in modo applies only to 'Items'. Keyframes are always set while in 'Items' mode with the modeling of objects done while at the component level, in the 'Vertices', 'Edges' and 'Polygons' modes. It is helpful for users to have an understanding of the differences between these modes. Layers in the items list should be thought of as containers. In 'Items' mode, users are editing the entire container, but while in the component modes, users are editing the contents of the container. Dynamics acts only at the item level, where each layer in the 'Items' list is its own dynamic Dynamics object. Therefore, if users wish to break apart a wall, each brick will need to be its own individual item layer. Users can easily accomplish stacks of bricks by simply creating the first brick item, and then assigning the 'Active Dynamic Body' tag to make the brick dynamic. Next, applying the 'Array' function in items mode will stack subsequent bricks, each inheriting the dynamics of the master object. With the wall created, all it takes is an animated wrecking ball to topple the bricks to the ground, complements of Dynamics.

Centers and Mass

The weight of Rigid Body objects is dependent on the position of the items 'Center'. The center point for an object doesn't only represent the center of rotation for the object, when using Dynamics it also represents the center of mass for the object. Dynamics will assume the weight of an object is equally distributed around the center point, so object will move based on this assumption. If the center point is placed too far away from the items actual center, or worse outside the volume of the object, odd behavior is sure to occur. Users can see an object Center position by hovering over the 3D viewport in question and pressing the 'O' key. In the 'Visibility' subtab, there is an option to show Centers for selected items.

There are several ways to deal with a center that's been moved, the easiest is to select the item in 'Items' mode and invoke the menu bar command "Edit > Center to Bounding Box > Center"; this will automatically move the Center point to the objects actual bounding box center (a bounding box is based on a models overall extents).

Users cannot manually (by keyframes) animate active dynamic objects, however, sleeping objects can be animated (and are handed off to Dynamics once they are awakened). If the animated object requires rotations from a position other than the objects true center, users should modify the 'Pivot' position and animate from there to maintain the proper center of mass.

Accuracy

The number one issue users run into when calculating a simulation is objects passing through one another (like dropping chain links together to form a chain and they fall right through each other). While it can be caused by a multitude of issues, it is most often caused by the speed at which objects move. At one frame they were apart from each other, the next they had passed right through one another. This means the default subframe calculations didn't have ample time to calculate the collisions of the objects. Even though we only see the result at the whole frame values, and lot can happen between frames. Users can increase this sub-frame accuracy with the 'Steps' values found in the Dynamics solver (properly calculating subframes for all keyframed items as well). Doing so makes Dynamics more accurate, however the additional calculations take longer to compute; more accurate = slower. Users should experiment with different values to find one that produces acceptable results with the least number of steps.

 

BulletBullet Physics

Dynamics is based on Bullet Physics, an open source collision detection and rigid body dynamics library that is free for commercial use, under the ZLib license. Thank you to Erwin Coumans and the Bullet developers for their efforts and generosity.

 

comment balloon Comments (1) RSS Icon

Marwan Kanaan April 7, 2013 at 3:57 PM

Where can we enable the 'Self Collision' option? Can't find it!

Top

back next