Friday 16 May 2014

Animating with Mikoto – part 6

We have rigged our model ready for animating in Mikoto.

I’m not very good at animating so how did I create the animation seen in part 1?

Mikoto can open *.bvh files which store motion capture data.

UPDATE: Mikoto cannot open *.bvh files which have values written in scientific format e.g. -8.759e-005.

In Mikoto’s Sample folder you will find dance01.bvh which is the file I used to animate Lara.

Click New in Mikoto to start a new project and then open dance01.bvh.

A new actor object named dance01.bvh is added to the project.
Each actor object is indicated in the tree with a cyan coloured cube icon.  icon_object

Select dance01.bvh by clicking on its name.

The hierarchy for a *.bvh file is displayed as circles containing small XYZ axes instead of bones.

Bvh

The project is the active item as indicated in the tree by a magenta coloured cube icon.  icon_scope

To play the animation you need to make dance01.bvh the active item.

To make dance01.bvh active, right click on it and select Scope from the pop up menu.

The project icon changes colour to cyan and the dance01.bvh icon changes colour to magenta.

If the animation plays too fast, click the clock icon in the toolbar.

PlayBvh

Stop the animation and make the project active again by giving it scope.
Open the *.mqo file to add our actor to the project.

Click dance01.bvh and notice the size difference between the *.bvh model and our model.

Both actors are visible because the project has scope.

TwoCharacters

Mikoto has a Motion Converter tool that can copy the motion from dance01.bvh to our actor. This is known as retargeting.

To use the Motion Converter, the actor to receive the motion must have scope and the actor sending the motion must be selected by clicking it.

MotionConverter

Click Tools>Motion converter to bring up the converter.

RetargetingBones

The motion will be copied from the actor on the right hand side to the actor on the left hand side.

To copy the motion you click a source bone in the right hand list and then click a target bone in the left hand list. The motion (rotations and translations) of the source bone will be applied to the target bone.

Retarget the bones as shown in the screenshot below.

Notice that the number of bones is different for the two actors so we have to choose which source bones best match a target bone.

Since we may need to change the retargeting, once all the target bones have been paired to a source bone save the target/source assignments as a Mikoto Motion Converter (*.mmc) file by clicking Save. Include the extension .mmc in the filename.

Click OK to convert the motion.

Since *.bvh files can contain many keyframes the conversion may take a few minutes.

ConvertMotion

LaraDancing

When you play the animation the rotations seem correct but Lara doesn’t translate, she is stuck to the origin.

To see why, give dance01.bvh scope, right click “hierarchy” and click EarlyPos in the pop up menu to display the rest pose of the actor.

BVHrestpose
In rest pose, dance01.bvh is standing on the floor grid so the root bone is positioned far above the floor whereas our actor’s root bone in rest pose is on the floor.

Notice also how dance01.bvh in rest pose is standing in the +Y direction, facing the +Z direction and has the arms down beside the body. This is very similar to our actor’s skeleton which is why this *.bvh motion can be successfully copied.

Give our actor scope, right click on “unknown” and click EarlyPos to set the rest pose.

Click the root section of the pelvis bone and click Y and drag to move the model up until the feet stand on the floor grid.

TranslateLara

Click dance01.bvh, click Tools>Motion converter and open the *.mmc file saved earlier.

Click OK to convert the motion once again. Play the animation and see Lara dance.

Success

The animation can be exported to a series of *.bmp files by clicking the Motion and clicking Tools>Export BMP.

The *.bmp files are screenshots of the 3D viewer.

Adjust the settings in the Export BMP dialog and click OK but be careful not to output thousands of frames. By default the *.bmp files are saved in the ScreenShots folder inside Mikoto’s folder.

Export BMP

The animation can also be exported as a sequence of *.mqo files.

Click Tools>Exp MQO anim and adjust the settings in the Export MQO Sequence dialog. If you have lots of frames be careful not to output them all since an *.mqo file can be created for every frame. By default the *.mqo files are saved in the ScreenShots folder inside Mikoto’s folder.

Export MQO
If you want to save one pose of your actor as an *.mqo, make sure the pose is displayed in the 3D view then right click on your actor’s name in the tree. Click Export and type your filename and with *.mqo selected as the extension from the dropdown list.

ExportPose

Exported pose in Metasequoia

If you want to save all the motions of your actor in a Mikoto Motion (*.mkm) file, once again right click on your actor’s name, click Export and select *.mkm as the extension.

Mikoto Motion files are text files that can be opened in a text editor.

MKM opened in text editor

The motions stored in an *.mkm file can be imported to another actor by right clicking on the actor’s name and selecting Import.

To save the entire Mikoto project, right click on “project” and click Export and save as a Mikoto Scene (*.mks) file

The *.mks file stores the path and filename of the files you opened in the project so don’t rename or move them or else Mikoto won’t find them when you open the *.mks.


prev | next

No comments:

Post a Comment