Endorphin:Руководство 14 - Активная анимация
| Руководство 14 - Активная анимация
| |
|---|---|
| |
ориг.название: Tutorial 14. Active animation вики-редакция: Garin ссылка на сайт: NaturalMotion обсудить на форуме: Обсудить на форуме версия оригинала: 1.0 версия вики: 1.0 |
| Этот материал нуждается в переводе или допереводе.. Вы можете помочь перевести его. Не забывайте предварительно добавлять строку {{Edit|--~~~~}} в материалы над которыми работаете, чтобы не создавать конфликта правок. Пожалуйста, снимите шаблон этого сообщения, когда материал будет вычитан. |
Endorphin: Руководство 14 - Активная анимация
Предисловие
In this tutorial, we will use animation events in a special new mode — Active Animation mode. In this mode, we can effectively use the data in an animation event dynamically as a sequence of active poses.
Active animation events and motion transfer events are broadly similar, in the sense that a dynamically simulated character is driven (and least in part) by animation data.
However, active animation events and motion transfer events differ in a number of ways. The most important difference is that active animation events drive simulated characters locally via their joints. They cannot drive the global position or orientation of characters themselves. In contrast, motion transfer events drive simulated characters globally via their mass objects.
In addition, motion transfer events offer the ability to specify individual rig node positional and angular strengths, whereas active animation events have a single Strength setting that affects all its target joints equally.
In this example scene, an animated sword swipe will be used to drive both a motion transfer event, as well as an active animation event.
Step 1: Loading the scene
In this step, we will load a scene that contains a reference character with an animation event preloaded.
To load the scene:
- Launch endorphin.
- Select File > Open Scene…, and browse to select
Resources\Tutorials\Tutorial 14 - Active Animation And Motion Transfer\SwordPlay_Begin.ens. Click Open.
- Simulate the scene. This scene is composed of a single AudioMotion1 reference character driven by an animation event of a sword swipe.
Step 2: Driving a simulation character using motion transfer
In this step, we will add a corresponding simulation character to the scene, and drive its motion using a motion transfer event.
To transfer motion to a simulation character:
- Select Character > Add Character…, or click the Add Character button in the Main Toolbar.
- Select the AudioMotion1 character from the Simulation Characters list.
- Right-click on the new AudioMotion1 simulation character timeline in the Timeline Editor, and select Create Motion Transfer Event. Adjust the Start Frame so that is starts one frame after the animation event on the reference character. Adjust the End Frame to match the end frame of the animation event.
- Select the new motion transfer event.
- In the Property Editor, locate the [Select] command hotlink adjacent to the Source Character property. Click this hotlink to enter selection mode, and select the Audiomotion1_ref reference character in the viewport, Node View or Timeline Editor. Right-click in the viewport to leave this selection mode. The AudioMotion1_ref reference character has now been identified as the motion transfer source.
- Simulate the scene. The AudioMotion1_ref reference character is driven entirely by the animation data contained in its animation event. The AudioMotion1 simulation character is dynamically driven by the reference character via the motion transfer event. Keep in mind that the AudioMotion1 simulation character is simulated during the motion transfer process. This means you can modify the motion of the simulation character with other endorphin functionality such as behaviours and active poses.
Step 3: Preparing the initial pose
In this step, we will adjust the start pose of the simulation character. Instead of using a T-pose, it will use the pose from the first frame of the animation. This will avoid the sudden jump that you see between Frame 0 and Frame 1.
To set the initial pose of the simulation character:
- Simulate for a short duration, so that at least a few frames of animation have been stored in the frame buffer, and then stop the simulation.
- Move the Time Slider to Frame 2. The AudioMotion1 simulation character should be in the first frame of the animation.
- Select the AudioMotion1 character, and then select Character > Save Pose….
- Save this pose as Start.nma. This creates an endorphin .nma pose file containing the character pose.
- Move the Time Slider to Frame 0.
- Ensure that the AudioMotion1 simulation character is still selected.
- Select Character > Load Pose…, and browse for the Start.nma pose file. Do not modify any of the Load Pose settings, and click OK.
- Simulate the scene. The AudioMotion1 simulation character motion should now be smooth, with no discontinuities between Frame 0 and Frame 1.
Step 4: Working with motion transfer rig groups
In this step we will create a new motion transfer rig group, so that the animation data only drives the lower body of the simulation character.
To create a new rig group:
- Display the Motion Transfer Editor by selecting View > Motion Transfer Editor. The keyboard shortcut is M. The Motion Transfer Editor is automatically displayed when you enter Character Edit Mode.
- Select the AudioMotion1 simulation character. The Motion Transfer Editor displays the settings for this character.
- Browse to the Strengths tab. This page displays a list of available rig groups. You should find that the only rig group is the Standard Motion Transfer rig group.
- Click the Add… button to create a new rig group. Name the new rig group Legs Only and click OK.
- Select all the rig nodes, and set the rig node mode to NoHold. You can select multiple rig nodes by holding down the Ctrl key.
- Select the RightUpperLeg, RightFoot, RightToes, LeftUpperLeg, LeftFoot and LeftToes rig nodes, and set the rig node mode to FullHold.
To use the new rig group with motion transfer:
- Select the motion transfer event on the AudioMotion1 simulation character timeline.
- Use the Property Editor to change the Rig Group property of the motion transfer event to Legs Only.
- Simulate the scene. You should find that the simulation character’s legs will be driven by the motion transfer event, whereas its upper body should be loosely flopping.
Step 5: Adding an active animation event
In this step we will add an animation event to the simulation character. This event will contain the same sword swipe animation data used in the reference character’s animation event. However, the new animation event will be used as an active animation event applied directly to the simulation character.
To add an active animation event:
- Select the Audiomotion1 simulation character.
- Select File > Import, or click the Import button in the Main Toolbar. The keyboard shortcut is I.
- Browse to select the SwordSwipe.fbx file, and click OK.
- Select the Hips node as the import root node in the node tree.
- In the Import Options dialog, turn off Create Simulation Events.
- When this setting is turned off, the character simulation mode is unchanged. In our case, this means the character will remain in Full Simulation mode, and so the animation will drive this fully-simulated character actively. In contrast, when simulation events are added to set the simulation mode to No Simulation, Collision Only or Collision With Momentum, the animation drives the character passively.
- Turn on the Transfer From Reference Character setting, and browse to select the AudioMotion1 reference character. Keep the other settings at their default values, and click OK.
- Animation will be imported from the SwordSwipe.fbx file using Auto Motion Transfer. A new animation event will be created.
- Note We now have two animation events in the scene, both using the SwordSwipe.fbx animation data. One of these animation events is applied to the reference character, and was created by direct animation import. The other animation event is applied to the simulation character, and was created using Auto Motion Transfer from the reference character.
- Ensure that the new animation event has its Start Frame set to Frame 0.
- Select the animation event and drag it upwards until it is placed on the topmost timeline track. This ensures that this new animation event has the highest priority in the simulation character timeline.
- Use the Property Editor to set the Strength property of the new animation event to 1.0.
- Use the Property Editor to turn on the Active property of the new animation event. This is the critical step that converts the event from a standard, or passive, animation event, into an active animation event.
- Simulate the scene. The same animation source file is now driving two different sections of the simulation character using two different routes. Each of these routes has a different effect:
- The motion transfer event drives the lower body of the simulation character using the animation event on the reference character timeline. This event drives the mass objects of the legs in global coordinates.
- The active animation event drives the upper body of the simulation character using the data in the event. This event drives the joints of the torso and arms in local coordinates.
Step 6: Connecting props to the simulation character
In this step we will add some mass objects to the simulation character. These objects will model the effect of weapons held by the simulation character.
To add a prop mass object to the Environment character:
- Select Environment > Create Sphyl Mass Object. Alternatively, click the Create Sphyl Mass Object button in the Main Toolbar. A new sphyl mass object is added to the Environment character.
- Select the new mass object. Using the Property Editor, set the mass object Length property to 0.8. Also, set the Radius property to 0.02.
- Use the Move and Rotate tools to position and rotate the mass object so that one end of the object is close to the right hand of the simulation character. Alternatively, enter the following values directly as the Position And Orientation properties of the mass object:
- Position: X: 0.22; Y: 0.70; Z: 2.43.
- Orientation: X: -44.0; Y: +46.0; Z: -64.0.
To connect the mass object to the simulation character:
- Right-click on the AudioMotion1 simulation character timeline in the Timeline Editor and select Create Constraint Event.
- Adjust the Start Frame and End Frame properties of the new constrain event to match the range of the animation events.
- Use the Property Editor to set the constraint event Type to JoinBodies.
- Locate the [Select] command hotlink adjacent to the Target Objects property, and click it. This places endorphin in selection mode, and allows you to specify the mass objects affected by the constraint.
- Select the new mass object.
- Hold down the Ctrl key and select the RightHandMass mass object.
- Simulate the scene. You should find that the character now holds the mass object during the sword swing.
Step 7: Adding collision objects to the environment
In this step, we will add a collision object to the Environment character. This object represents an object that the simulation character may be striking.
To add a collision object to the Environment character:
- Ensure no objects are selected. The Property Editor should be displaying the Simulation Settings and Timeline Settings.
- Create a new box collision object in the Environment character by selecting Environment > Create Box Collision Object, or by clicking the Create Box Collision Object button on the Main Toolbar.
- Select the new collision object.
- Use the Property Editor to set its Width value to 1.0. Also, set its Height and Length values to 0.25.
- Use the Move and Rotate tools to position the new collision object in front of the simulation character. Alternatively, enter the following values directly as the Position And Orientation properties of the collision object:
- Position: X: 0.0; Y: 1.08; Z: 3.10.
- Orientation: X: 0.0; Y: 0.0; Z: 0.0.
Step 8: Modifying the mass object density
In this step, we will change the density of the mass object representing the weapon held by the simulation character.
To modify the density of the mass object:
- Select the Prop01 mass object.
- Use the Property Editor to increase its Density value to 10.0.
- Simulate the scene. You should see the right arm of the simulation character swing more slowly than its corresponding source animation data. This is due to the inertia of the heavier mass object.
- Experiment with different density values.
Step 9: Modifying the active animation event strength
In this step, we will modify the strength of the active animation event. The strength of an active animation event is very similar to the strength of an active pose event. This is because active animation events are effectively just a sequence of active poses.
To modify the strength of the active animation event:
- Select the active animation event on AudioMotion1 simulation character timeline.
- Use the Property Editor to set its Strength value to 0.3.
- Simulate the scene. You should find the simulation character slumping and unable to raise the mass object to its previous height.
- Experiment with different active animation strength values.
Step 10: Modifying the collision object material
In this step, we will modify the material of the collision object. Materials specify the surface friction properties of an object. For example, you can specify a collision object as being smooth or rough. Materials also specify the volumetric properties of an object. For example, you can specify whether an object is rigid, soft or rubbery.
To change the material of the collision object:
- Select the active animation event on the AudioMotion1 simulation character timeline, and set its Strength value back to 1.0.
- Select the box collision object created in Step 7.
- Use the Property Editor to set its Material property to Rubber.
- Simulate the scene. You should find that the mass object now bounces off the collision object after colliding with it. Also note that this bounce affects the simulation character itself, in addition to the mass object.
- Experiment with different animation strength values and materials to modify the collision response.
- Use the Property Editor to set the Material property of the collision object to Sponge.
- Simulate the scene. You should now find that the mass object penetrates the collision object after colliding with it.
Step 11: Adding a helper constraint
In this step, we will add a short-duration constraint event. This constraint will lock the mass object for a few frames, in order to mimic the effect of the mass object becoming temporarily lodged inside the collision object.
To add a help constraint event:
- Right-click the AudioMotion1 simulation character name in the Timeline Editor, and select Add Event Track. This adds a new event track to the character’s timeline.
- Simulate the scene, in order to fill up the frame buffer.
- Move the Time Slider to the frame at which the mass object has its deepest penetration into the collision object.
- Right-click on the simulation character timeline at this frame, and select Create Constraint Event. You will automatically be placed into selection mode. This mode allows you to specify the mass objects that are to be constrained by the constraint event. When you are in the selection mode, endorphin displays the text Selecting… in the viewport label.
- Select the sword mass object.
- Modify the constraint event End Frame so that the event has a duration of around 45 frames. For example, it might have a Start Frame of Frame 50, and an End Frame of Frame 95.
- Simulate the scene. You should find that the sword mass object now penetrates into the collision object, and is held in place for the duration of the constraint event. When the constraint event ends, the mass object springs back and the character quickly resumes its original animation.
Conclusion
You have learned to use active animation events poses, which effectively influence the motion of simulated characters via a sequence of single-frame active pose events. You have also used helper constraints to increase the realism of simulated scenes.
If you have any problems with this tutorial, open the corresponding scene Resources\Tutorials\Tutorial 14 – Active Animation And Motion Transfer\Tutorial 14 – Active Animation And Motion Transfer - Complete.ens . This scene is an example of how your scene should look if you have successfully followed all the steps in this tutorial.




