比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

You may or may not be familiar with state machines. You will find plenty of explanations on the internet about what they are and how they work, especially in the gaming field.

To put it in simple words, state machines are a way for defining a number of animation states (walk, idle, run, etc) and how you can transition from one state to another. To make things even simpler, you might think of a state machine as a graph having nodes (the states) and connected to each other (connections are the transitions).

The Atoms UI has a state machine editor where you can define state machines to be used in Atoms. For a full list of actions please check the quick help at the bottom right of the GUI.


For creating animation states right click on the viewport and select "add animation state" or click the "Add state" button.
You create connections by right clicking on a node and dragging.

The Inspector

The inspector is where you set up your state and transition clips.

In case you're setting up an animation state, you have to give it an id which will later be used by several Atoms Behaviour Modules such as the State machine (a unique id is given set as default by the editor). Each state in the same state machine must have a different id.

You can assign more than one clip to each animation state or transition.
There are three different merge modes:

  • Exclusive : only the exclusive clip will be played. This mode has the highest priority. If you have an exclusive clip all the other clips will be ignored. If you have more than one exlusive clip only the first one will be used.
  • Merge : all merge clips will be merged together. This has higher priority over the random mode. Having only a merge clip is like setting its mode to exclusive.
  • Random : one of the random clips in the list will be played. At the end of each clip another random clip is used. From Atoms 2.1.0, you can control the random probability of each clip with agent metadatas. Specify the metadata name inside the tag field, then add a metadata with that name on your simulation agents. The metadata value represents the weight used by the random function.

Finally there are also seven different motion modes: Straight, TurnLeft, TurnRight, TurnUp, TurnDown, BankLeft, BankRight.
Only clips with the same motion mode will be merged together, randomized or will exclude each other.

At each frame your agent direction changes and the angle described by the agent direction at the current frame and the direction at the previous frame will be used by the blending system.
For instance, when setting a TurnLeft clip with angle value to 1 and blend to 2, our agent will start blending the Straight clip with the TurnLeft clip when the mentioned angle will be between from 1 to 3 degrees (3 is simply the angle value plus the blend value)2 degrees. When the angle will be more than 3 2 the TurnLeft clip will be played.
The angle and blend values are in degrees. 

The max turn angle field is limits the angle variation (degrees) at each frame.

This random loop option(on by default). When an agent enters the given state and the state has all clips in random mode:

  • Off: a random clip will be picked and it will be used in a loop.
  • On: a random clip will be picked at random every time playing clip ends.
注意

Whenever a one shot clip (non-loopabe clip) is used inside a state, the transition will be triggered as soon as the animation of that clip ends.


Transitions

When connecting two animation states you can select the transition and assign a transition clip within the inspector.
A light blue dot will appear on your transition in the editor as soon as you assign a clip to a it.

The transition UI is similar to the state UI, the only difference is that you can specify a blend in and out frame value for the transition itself.

If you don't specify a transition clip between two states and in your simulation you pass from one of those to the other, Atoms will do a straight blend between them.

If two states do not have a transition you won't be able to pass from one to the other.

注意
Please always give a name to your transitions or they won't be evaluated by Atoms.


Preview

The preview widget  displays the animation for the selected state. At the bottom you have controls for playing/scrubbing the animation and a control for changing the joint size.

Before the animation can be displayed the user must select a valid agent type from the drop down list at the top of the UI.

When you select a transition (connection) between two states the preview will show its animation.

Yellow circles appearing under the feet show the foot down state for each foot.

By right-clicking on the viewport, a menu will appear with the following options:

  • Draw grid: enable/disable the grid in the viewport display
  • Draw Joint Axis: enable/disable the joint axis in the display
  • Lock Camera: enable/disable the locking on the camera
  • Reset Camera: resets the translation/rotation of the camera
  • Test Loop: enable/disable the animation clip looping

Navigation Controls:

  • Alt + left click and drag: Rotate camera
  • Alt + middle click and drag: Pan camera
  • Alt + right click and drag: zoom camera