Animation retargeting is the process of transferring animations intended for one character onto another.
The skeleton structures and their proportions may differ.
Retargeting allows you to use the same set of animations on different characters.
In this article we will retarget motion capture animations
created by the Motion Capture Center of the ACCA (The Advanced Computing Center for the Arts and Design), the
Ohio State University:
http://accad.osu.edu/research/mocap/mocap_data.htm.
From the presented on the page we use one of the following sets of animations in BVH format:
Female 1, Male 1, Male 2.
The target character is Izzy from Reallusion.
Character is available for download at Unity Asset Store https://www.assetstore.unity3d.com/en/#!/content/50690
.
We will use Autodesk MotionBuilder 2015 for retargeting
and iClone 3DXchange5 for auxiliary purposes.
Our goal is to show all the stages of the retargeting process, including mocap import and animation export to BVH.
We will also solve problems that will arise.
Steps
Notice!
To adjust the T-pose of any of the skeletons, you must remove the [ ] Characterize option from both characters.
-
When you import the animations in MotionBuilder (we work with Male2_*.bvh),
you can see the following picture. You can correct this "skewness" problem by exporting the animations
from iClone 3DXchange to BVH with the "Reset bone offset" flag.
-
That's what we mean by "skewness" of Hips when importing Male2 animations into MotionBuilder:
!['skewness' of Hips](images/image50.png)
-
After the import to iClone 3DXchange the model is fine:
![after the import to iClone 3DXchange the model is fine](images/image54.png)
-
Drag-n-drop any of the Male2_*.bvh into iClone 3DXchange.
-
Then drag-n-drop all the rest animations you need into the Motion Library:
![drag-n-drop all the rest animations you need into the Motion Library](images/image60.png)
-
Press Add All to Perform.
![Add All to Perform](images/image15.png)
-
Now we have all the animations in the Perform Editor section.
![Now we have all the animations in the Perform Editor](images/image34.png)
-
Export them. File -> Export to Other 3D Format -> Export BVH...
-
Set [x] Reset Bone Offset and press OK.
![Set [x] Reset Bone Offset and export the animations`](images/image14.png)
Note: “File Name” is a prefix. Also, this field cannot be empty.
-
Male2 animations are fixed:
![animations are fixed](images/image35.png)
-
Now we can move on. Open Girl.fbx in MotionBuilder (you can download it at Unity Asset Store
https://www.assetstore.unity3d.com/en/#!/content/50690).
-
Click File -> Motion File Import…, choose any of the fixed *Male2_*.bvh, for example *Male2_A5_PickUpBox.bvh.
- Import Options:
![Import Options](images/image59.png)
Note that we select Create (not Merge).
-
The scene looks like this:
![the scene](images/image38.png)
![the scene, hierarchy](images/image21.png)
Avatar — reference Girl;
RL_G6_Hip — Girl root bone (Hips);
BVH:reference — Male2 reference;
BVH:Hips — Male2 root bone (Hips).
-
Select Asset Browser Templates / Characters / Character.
![Asset Browser Templates / Characters / Character](images/image46.png)
-
And drag-n-drop onto the Girl skeleton. The Characterize tooltip pops up. Click it.
![Characterize tooltip](images/image40.png)
Alternatively, you can drag-n-drop onto the Hips bone in the Navigator / Scene
![Alternatively, you can drag-n-drop onto the Hips bone in the в Navigator / Scene](images/image27.png)
-
The following message pops up:
Press Ok.
-
One more message:
![One more message](images/image17.png)
Press Close.
-
Rename the newly created character (Character)...
![Переименуем только что созданного персонажа](images/image36.png)
...to GirlChar.
![rename to GirlChar](images/image53.png)
-
Double click on the GirlChar.
-
Make sure that Character: GirlChar is selected in Character Controls and the Definition tab is opened.
![Make sure that Character: GirlChar is selected in Character Controls and the Definition tab is opened](images/image44.png)
-
Now - the process of mapping the bones. LMB (click with the left mouse button) on the bone in the viewport:
![the process of mapping the bones](images/image52.png)
-
RMB (right mouse button click) on the corresponding bone in Character Controls / Definition, Assign Selected Bone:
![Character Controls / Definition, Assign Selected Bone](images/image56.png)
-
Hide the model:
![Hide the model](images/image29.png)
-
A good sign is the correspondence the character bone names
and the internal representation in MotionBuilder:
![correspondence of the names of the Girl's bones and the internal representation in MotionBuilder](images/image13.png)
-
Do not forget about smaller bones, such as Shoulder (Clavicle):
![Do not forget about smaller bones, such as Shoulder (Clavicle):)](images/image48.png)
-
The minimal set to map is all the bones from the "Base (required)" group.
![The minimal set to map is all the bones from the 'Base (required)' group](images/image24.png)
-
Now set Characterize.
![Now set Characterize](images/image26.png)
-
Select Biped:
![Select Biped](images/image20.png)
-
Go to Male2. Drag Character onto Male2 skeleton:
Press Characterize.
- Select Biped:
![Select Biped](images/image05.png)
-
Rename the newly created Character to MaleChar.
![Rename the newly created Character](images/image10.png)
-
Male2 bone mapping is allright.
![bone mapping is allright](images/image39.png)
-
The thing is its current pose will be considered a T-pose.
![The thing is his current pose will be considered a T-pose.](images/image00.png)
-
Turn off [ ] Characterize from MaleChar.
-
Select BVH:Hips, RMB -> Select Branches.
![BVH:Hips Select Branches](images/image32.png)
-
RMB -> Zero -> Rotation.
![Zero -> Rotation](images/image25.png)
- Will get this:
![after Zero -> Rotation](images/image57.png)
-
Now we need to turn this into a T-pose.
-
Rotate the bones with the MaleChar [ ] Characterize switched off until we are happy with the T-pose.
-
Turn on MaleChar [x] Characterize.
-
Turn on GirlChar [x] Characterize.
-
Open GirlChar Character Settings and select Input Type: Character, [x] Active; Input Source: MaleChar.
![GirlChar - select Input Type: Character, [x] Active; Input Source: MaleChar](images/image28.png)
-
Play the animation. Girl skeleton must reproduce the Male2 animation.
![Play the animation](images/image01.png)
-
To "bake" the retargeted animation, press Plot Character.
![press Plot Character](images/image06.png)
-
Select Skeleton.
![Select Skeleton](images/image49.png)
-
The default settings are fine.
![The default settings are fine](images/image04.png)
A detailed description of these parameters:
http://mocappys.com/retargeting-animation-motionbuilder/#Plot_Properties_Window_Explained
-
Check that the plotting was successful.
![plotting was successful](images/image55.png)
With these settings, the GirlChar character will keep the animation.
-
Select the Hips bone of the Girl character.
![Select the Hips bone](images/image12.png)
-
File -> Motion File Export…
![File -> Motion File Export](images/image37.png)
Make sure that "Content: Selected Models and Children" is selected.
-
The message pops up:
![The message pops up](images/image30.png)
Press Yes (three times).
-
See the "RL_G6_Hair 1" bone:
![RL_G6_Hair 1](images/image58.png)
-
Rename this bone to "RL_G6_Hair_1".
-
Select the Hips bone and press File -> Motion File Export.
-
The operation should be successful.
-
Open the exported BVH in iClone 3DXchange. Play the animation.
![Open the exported BVH in iClone 3DXchange](images/image11.png)
- It would seem that everything is fine.
- Let's check how MotionBuilder sees this BVH.
- Create an empty MotionBuilder project.
-
File -> Motion File Import. Import the newly created BVH.
-
Notice something wrong with the head pose.
![something wrong with the head pose](images/image41.png)
-
The workaround is to export the BVH from iClone 3DXchange with the [x] Reset Bone Offset flag.
-
Export.
![Export](images/image45.png)
-
Rename the fixed BVH:
![Rename the fixed BVH](images/image51.png)
Everything is fine.
-
This is how we retargeted a single animation.
- Now let`s retarget multiple animations at once.
- Open our main scene with MaleChar and GirlChar.
- Select BVH:Hips.
-
File -> Motion File Import.
![File -> Motion File Import](images/image22.png)
-
When importing a large number of animations, the following error may occur:
![When importing a large number of animations, the following error may occur](images/image42.png)
-
In this case, divide the original set into several parts and import them separately.
We are fine with two batches, approximately 75 animations each.
-
After you have finished importing all the necessary animations, select GirlChar and link it to the MaleChar:
![link GirlChar to the MaleChar](images/image03.png)
-
Double click the takes to start the playback of the corresponding animations
![Double click the takes to start the playback of the corresponding animations](images/image08.png)
-
Next we call Plot Character on the GirlChar.
![call Plot Character on the GirlChar](images/image07.png)
-
Select Skeleton:
![Выбираем Skeleton](images/image02.png)
-
Important checkbox to enable — [x] Plot All Takes.
![[x] Plot All Takes](images/image18.png)
-
Check the retargeting quality by observing behaviour of the model.
![Check the retargeting quality by observing behaviour of the model](images/image09.png)
-
Select the root bone (Hips) of the Girl character and File -> Motion File Export.
![Select the root bone (Hips) of the Girl character and File -> Motion File Export](images/image43.png)
-
As you might have guessed, the BVH animations been produced must be re-exported with iClone 3DXchange
and it`s [x] Reset Bone Offset flag on.
![the BVH animations been produced must be re-exported with iClone 3DXchange and it`s [x] Reset Bone Offset flag on](images/image23.png)
- Victory!
![Victory!](images/image31.png)
-
Now import those BVH animations into the empty MotionBuilder scene to check that they are fine:
![import the BVH animations into the empty MotionBuilder scene to check that they are fine](images/image47.png)
-
Check all the animations (double click on the takes).
![Check all the animations (double click on the takes)](images/image33.png)
-
Now we can use these BVH animations to
train the deep neural network.
References
- http://mocappys.com/retargeting-animation-motionbuilder/#for_retargeting_Multiple_File
(this section in particular and the entire document as a whole)
- http://www.3dbuzz.com/forum/threads/186992-Multiple-bvh-s-in-MotionBuilder
Got questions? Contact us: