Animation Baker

How To Bake

  1. Open Baker from the Unity toolbar.

    Spirit604/Animation Baker

  2. Customize texture settings.

  3. Drag & drop selected SkinnedMeshRenderer of pedestrians into Skins field.

  4. Drag & drop selected animations of pedestrians into the Clips field.

    _images/SourceDataExample.png

    Drag & drop example.

  5. Press the Create new button.

    _images/SourceDataResult1.png

    Multiple animation result example.

  6. In the project view, check the Animation Texture Data result.

    _images/AnimationDataExample.png

    AnimationData result example.

How To Bake Multi-Mesh

  1. Enable Multimesh type in the Settings type.

  2. Customize modular character with desired skinned mesh renderers.

  3. Add gameobjects with the desired attachments to the child of the desired bone [optional].

  4. Drag & drop character parent to source skin list.

  5. Make the same steps for baking.

Baker Window

Settings

_images/Settings.png
Animation material base : base animation material.
Frame rate : frame rate of baked animation.
Settings type:
  • Frame rate : shows frame rate settings.

  • Common : shows common settings (custom offset & custom animation name).

  • Transition mode : allows you to preview the transition from one animation to another in the editor.

  • Animation binding : shows binding settings of the Animation collection.

  • Multimesh : allows you to bake animations with multi-skin renderers or with custom attachments [v1.0.5+].

Add normal texture : add normal texture.
Compression type:
  • Uncompressed : uncompressed format of baked texture.

  • Compressed : compressed format of baked texture. [currently not available]

Texture bake type:
  • Single texture : bake all characters to single texture.

  • Multiple textures : bake each character to unique texture.

Clip data template path : path to clip templates.
Save texture data path : creating path of texture animation data.
Save texture path : creating path of baked textures.

Source Data

Toolbar

_images/Toolbar.png
Skins : source SkinnedMeshRenderer of characters.
Skin toolbar : character selection toolbar for selecting preview animation.

Clip Data

_images/ClipData.png
  • Clip : reference to the clip.

  • Custom frame rate : custom frame rate of the clip.

  • Interpolate : on/off interpolation feature for the clip.

  • Offset : local offset of vertices in baked animation.

  • Custom animation name : custom animation name (if the field is empty the name from the clip will be taken).

  • Preview : on/off preview playback of baked animation (make sure the texture is created and any character is selected in the toolbar).

How To Preview
  1. Bake the texture.

  2. Select any character (for example Character1).

  3. Press the Preview button.

  4. Make sure that Refresh Always option is enabled in the editor.

    _images/RefreshAlways.png
How To Bind
  1. Select Animation collection in the settings.

  2. Enable Animation binding type in the Settings type.

  3. In the Clip data select the animation from the Animation collection according to required animation.

Texture Data

Shows a preview of the created texture.

_images/TextureData.png

Transition Data

Shows a preview of the transition animation between two selected animations.

_images/TransitionData.png
  • Transition type:
    • Play once : animation plays only once.

    • Play forever : animation looped forever.

  • Transition duration : time to end of current animation when interpolation transition between animations is enabled.

How To Use
  1. Enable Transition mode in the settings.

  2. Bake the texture.

  3. Select any character (for example Character1).

  4. Press the Preview button for the source transition animation.

  5. Then, press the To button next to the animation you want to target.

  6. Adjust the Transition duration if required.

Buttons

Create new : create a new texture.
Save as new : save the texture as a new asset.
Override exist : overrides existing texture & data.
Clear : clean up the texture.

Animation Texture Data

_images/AnimationDataExample.png

Example.

Crowd GPU Animator

The Crowd GPU Animator is used for transitions between GPU animations.

How To

Open

Open in the scene CrowdGPUAnimatorAuthoring.

Hub/Configs/BakerRefs/Settings/CrowdGPUAnimatorAuthoring

_images/CrowdGPUAnimatorAuthoring.png

Initial Set Up

Steps:
  1. Create an Animator Data Container from the project context and assign it to the custom animator (if necessary).

  2. Create (if necessary) and assign Animation Collection the same as in the PedestrianCrowdSkinFactory.

_images/CrowdGPUAnimatorAuthoring.png

Create Node

Right-click in the window and select the desired node from the context menu.

Create Transition

Transition is a sequential set of nodes StartNode–>AnimNode–>TransitionNode–>AnimNode–>TransitionNode–>AnimNode–>… (example).

Steps:
  1. Create a new transition layer (if required).

  2. Enter the name of the trigger in the StartNode.

  3. Create and connect AnimationNodes and TransitionNodes.

Create Transition Layer

Press the + button on the main toolbar at custom animator to create a new layer, or press - to delete the currently selected layer.

Test

You can test the transition between two animations & adjust the transition duration in the editor in AnimationBakerWindow.

Graph Nodes

Start Node

Node where the transition begins by trigger.

_images/StartNodeExample.png
Trigger name : name of the trigger on which the transition starts.
Hash : hash of the trigger on which the transition starts.

Note

Hash from trigger name generated by Unity method Animator.StringToHash

Animation Node

Animation playback node.

_images/AnimationNodeExample.png
Asset name : asset data name.
Anim name : animation name (by default is taken from Anim enum).
Anim enum : list of available animations in the Animation Collection
Unique animation : unique animation mesh instance will be created for this animation.

Transition Node

Node with settings for switching between animations.

Node Type:

  • Defaultanimations play sequentially one by one without interpolation.
    _images/TransitionNodeDefaultExample.png
  • To Startthe previous animation is interpolated to the beginning of the next animation with the set duration.
    _images/TransitionNodeToStartExample.png
  • To Global Syncthe previous animation is interpolated to the global playback time of the next animation with the set duration.
    _images/TransitionNodeToGlobalSyncExample.png

Transition example

_images/StartSitTransitionExample.png

Start sit transition example.

_images/SitoutTransitionExample.png

Sitout transition example.

Animation Collection

Contains meta-data of existing animations for the pedestrians.

How To Create

From the project context :

Spirit604/Animation Baker/Animation Collection

Settings

_images/AnimationCollectionExample.png
Name : animation name.
Unique animationa unique animation mesh instance pool will be created for this animation.
  • Allow duplicate : is it allowed to take an animation from the pool if it is already being used by another character.

  • Instance count : animation pool size.

Animation type:
  • Mandatory : each entity of the crowd must have this animation.

  • Optional : each entity of the crowd doesn’t necessarily have to have this animation [step 16].

Animator Data Container

Contains data about animation transitions.

_images/AnimatorContainerExampleSource.png
Layer Datacontains data about transition.
  • Entry node : asset node where the transition begins.

  • Activate trigger : name of the transition activation trigger.

  • Activate trigger hash : hash of the transition activation trigger.

  • All nodes : all transition nodes.