Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:bvhfiles [2011/07/11 20:36]
mike created
en:bvhfiles [2011/07/21 15:22] (current)
mike
Line 1: Line 1:
 ====== Working with Motion Capture Animation (BVH files) ====== ====== Working with Motion Capture Animation (BVH files) ======
- 
  
 It is possible to import motion capture animation into the pose editor. Motion capture is a technique that records real motion from humans with markers and converts that into a digital format. This is typically used for film effects but is also becoming increasingly used in games. Second Life is a popular MMO that uses motion capture animation for it's avatars. It is possible to import motion capture animation into the pose editor. Motion capture is a technique that records real motion from humans with markers and converts that into a digital format. This is typically used for film effects but is also becoming increasingly used in games. Second Life is a popular MMO that uses motion capture animation for it's avatars.
Line 7: Line 6:
 In order to see the Motion Capture folder, you need to put some BVH files in it first. In order to see the Motion Capture folder, you need to put some BVH files in it first.
  
-1) Copy your BVH files to the %%PoseEdit%% folder. This is under the Mod folder. This will be under your user data folder which will typically be somewhere like: C:\Users\<yourname>\%%AppData%%\Roaming\thriXXX\%%3DSexVilla2%%-Everlust\Mod\%%PoseEdit%%+1) Copy your BVH files to the %%PoseEdit%% folder. This is under the Mod folder under your user data folder. The easiest way to find it is to go to your Windows Start menu, find the Thrixxx program folder and click on "Open Mod Folder"\\  
 +{{:en:editors:mocap:bvh_locate.png|}}
  
 2) Get into the Pose Editor 2) Get into the Pose Editor
  
-3) Click the load button \\ +3) Click the load button at the top of the Animation Panel \\ 
 {{:en:editors:mocap:bvh_load.png|}} {{:en:editors:mocap:bvh_load.png|}}
  
Line 22: Line 22:
  
 BVH Files in the Second Life format work the best. There is a list of SL animation files at [[http://wiki.secondlife.com/wiki/Internal_Animations]] and a zip file of them in BVH format [[http://static-secondlife-com.s3.amazonaws.com/downloads/avatar/bvh_files.zip|here]] BVH Files in the Second Life format work the best. There is a list of SL animation files at [[http://wiki.secondlife.com/wiki/Internal_Animations]] and a zip file of them in BVH format [[http://static-secondlife-com.s3.amazonaws.com/downloads/avatar/bvh_files.zip|here]]
 +
 +Here are some additional sources: (**Note:** these will probably all need massaging/converting. See the BVHacker section below)
 +  * [[http://motioncapture.forcevfx.com|ForceVFX.com]]
 +  * [[http://www.cgspeed.com|cgspeed.com]] - BVH conversions of the Carnagie Melon datasets
 +  * [[http://www.animazoo.com/bvh-downloads/|animazoo]] (requires free registration)
 +  * [[http://www.beyondmotion.com.au/free_motion.html|Beyondmotion]]
 +
  
 ==== Moving an animation into the correct position ==== ==== Moving an animation into the correct position ====
 +You may find that the base position for the model is floating in the air or somewhere you don't want it. Here's a quick way to move the model into position.
  
 +1) Select all the keyframes (or just all the "hip" keyframes") in the Key Frame panel (drag a box to select). This is so the adjustment will apply to all the keyframes and not just the current one.\\ 
 +{{:en:editors:mocap:bvh_select_key_editor.png|}}
  
-==== Changing the speed of an animation ====+2) Select the move hip joint in the joint layout view \\  
 +{{:en:editors:mocap:bvh_hip.png|}}
  
-The only method currently available for changing the animation speed is to cut and paste the keyframes in the Animation Timeline window. This is known as the "Brute ForcemethodApologies up front. +3) Hold down "shift". This will move all the joints that are children of the hip as wellOtherwise the hands and feet will stay in their current positions when the hips move
-  - Select the last keyframe in the Timeline panel \\ + 
-  - Right click and select "Cut Keys -> [character name]" \\  +4) Move the model into position using the move manipulator 
-  - Move to an empty part of the timeline (E.gover on the right side) and right click -> paste the keyframe there \\  + 
-  - Repeat this process but paste the next keyframe two keyframes to the left of the first one to add some "time" in between them \\  +You may also need to adjust the feet. See below.
-  - Repeat for all the remaining keyframes (except for the first keyframeThat one has to remain at frame 0) \\  +
-  - Open the Key Editor window by clicking on the Key icon at the top of the Animation panel \\  +
-  - Drag a box around ALL the keyframes (except for the first keyframe. That one has to remain at frame 0) \\  +
-  - Right click and "cut keys" in the Key Editor panel \\  +
-  - Move the current frame to frame 3 in the Timeline panel \\  +
-  - Right click and "paste keys" in the Key Editor panel \\  +
-  - Play that sucker back and hope that it's slow enough! \\ +
  
 ==== Adjusting feet and other body parts ==== ==== Adjusting feet and other body parts ====
 +You may run into models that have feet or hands that look like this: \\ 
 +{{:en:editors:mocap:bvh_floater.png|}}
 +
 +This can't be fixed by moving the whole body as outlined previously. The issue here is that the foot locators are not in the correct position. These are invisible objects in space that the feet are trying to reach for, similar to the ones that the elbows point at. \\ 
 +{{:en:editors:mocap:bvh_floater2.png|}}
 +
 +You can then reposition the whole body as needed.
  
 ==== Understanding the BVH file format ==== ==== Understanding the BVH file format ====
 http://www.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html http://www.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
  
-==== Making the BVH file interactive ====+If you find a BVH file that you really want to use but it's not in the correct format, you can try changing the joints to match the ones in the sample Second Life files. The BVH file can be edited in a simple text file editor like Notepad. 
  
-==== Additional tools for working with BVH files ====+==== Using BVHacker to get BVH files working in the Pose Editor ==== 
 +[[http://www.bvhacker.com/|BV Hacker]] is a free program that loads and manipulates BVH files. It allows you to preview the motion. It will also attempt to convert the data to Second Life format but it may not always do this successfully. Here are some common issues that you may run into and suggested solutions.
  
 +== Fixing joint errors and getting the file to load in the Pose Editor ==
  
 +The Pose Editor needs to find the main joints that are used on the model.
 +
 +Here are a couple of representations of the skeleton hierarchy used on the models. You may find that some versions of BVH have the Abdomen joint listed after the rThigh and lThigh joints. This is OK as long as they are still at the same level in the hierarchy.
 +
 +| **Here's a diagram of the hierarchy that works in the Pose Editor** | **Here's how that looks as a text hierarchy like you would see in the BVH file** |
 +|{{:en:editors:mocap:bvh_hierarchy_chart.png|}}|{{:en:editors:mocap:bvh_hierarchy_text.png|}}|
 +
 +Under the "hack" menu, select "Attempt SL joint naming". This will attempt to rename the joints. It will probably give you a list of joints that it couldn't rename and recommend deleting them. This isn't a big issue, you can probably still import the file and the Pose Editor will ignore the extra joints.
 +
 +If you still get errors after the "SL joint naming", you can try manually renaming joints by right clicking on them. Ensure that all the joints in the Thrixxx hierarchy are represented. Additional joints will be filtered out so you can either leave them in or delete them.
 +
 +
 +== Changing the speed of an animation ==
 +
 +You can speed up the animation by using the "1/2 sample" button. This will cut out every other frame each time you click it effectively doubling the speed. There isn't an easy way to slow the animation down but you probably won't need to do that. Usually the mocap animations are too slow.
 +
 +== Cropping the animation ==
 +
 +A lot of motion capture files have extra frames that you probably don't want. You can trim the animation by marking the start frame with the "Mark In" button and the end with the "Mark Out" button. Then hit the "Crop" button to trim out everything else.
 +
 +== Scaling the joints ==
 +The joints in the BVH file have a fixed position in world space (actually an offset from the hip - but same result). This is probably not the same as world space scale in the Pose Editor. It is possible to scale the joint positions but there are some quirks in the process. You can use "CTRL +" to scale the model up and "CTRL -" to scale the model down. Unfortunately, there isn't a way to adjust the scaling increments so you can just try to get the model within the right ballpark. If the joint scale is too large you will have the foot end effectors (where the feet are reaching to) too far down. If the scale is too small the model may be hunched over or have her arms too close to the body. If you experiment and keep reloading the model in the Pose Editor you can find the closest scale and adjust from there.
 +
 +== Fixing joints that are in the wrong place ==
 +
 +You may find that the animation converts but that the shoulders are too close to the body or the feet aren't rotated correctly. Adjust the scaling first (see above) to get the joints as close as you can. You can then adjust the offset position of individual joints by using the Adjustment sliders on the right side. This applies both to translation (position) and rotation. Make an adjustment to the slider, save the file again and then reload in the Pose Editor. Repeat for any position or rotation issues until you get it right. **Tip:** if the feet don't rotate in the animation you can just delete the rotation keyframes for the feet in the Key Editor and adjust the rotation manually.
 +
 +
 +==== Making the BVH file interactive ====
 +*** UNDER CONSTRUCTION ***