分类:
2011-05-05 10:01:21
Blender supports importing mocap data in the BVH format.
blender支持直接导入BVH格式的动作捕捉文件。
Importing is accomplished through a script:
导入是通过一个脚本来实现的。
go to File>Import>Motion Capture
(.bvh).
菜单路径:file>Import>Motion capture(.bvh)
When you select a BVH file, the script automatically generates
an Armature object (bone rig) with the bone names and hierarchical
relationships in the BVH file.
当你选了一个BVH文件,这个脚本会利用BVH文件中的骨骼名称与层级关系,自动生成一个armature对象(bone rig:骨骼操控)
The animation is stored independently as an Action (block of animation keyframe data) that is automatically assigned to the rig.
相应的动画会单独存储成一个动作(动画关键帧数据块),并且赋给操控(rig,以后直接用rig)
In order for retargeting to work well,
为了保证重定向工作正确,
the new target rig should have the same relationships as in the BVH rig.
新的目标操控rig,应该与BVH文件中rig相同的关系。
In Blender I have found that
the fastest and easiest way to do this is to simply use a copy of the
same rig.
在blender中我发现最便捷的方式就是拷贝一份相同的rig.
Editing a rig in Blender to a new character regardless of size or shape is a snap.
在blender中编辑一个rig给新的角色,不用管在snap中的大小,形状。
What I have found works well is to edit the character mesh into a T-pose that matches the BVH rig rest pose.
我现在只要把角色的mesh编辑成匹配BVH rig剩余的T-pose(T形姿势)就能工作正确。
This ensures that the animation will play correctly.
这能保证动画播放正确。
Also any major scaling – say to the size of a mouse – should be done in Object Mode.
当然,任何的缩放:也就是鼠标的大小是应该在object 模式下完成的。
Any other reshaping of the Armature object to fit the character can be done in Edit Mode.
任何改变Armature对象形状来匹配角色的操作应该在Edit模式下完成。
Once this is done, we can take advantage of Blender’s data system to quickly and easily retarget any new Action data from an imported BVH file to the Armature of a character.
如果这个做完了,我们就能利用Blender的数据系统来便捷的重定向任何新的动作到从导入的BVH文件到一个角色的Armature 。
In Blender, an Action contains a set of keyframe data as a separate
block of information that can be swapped from rig to rig.
在blender中,一个动作包含一套关键帧数据块可以从一个rig交换到另一个rig.
Also you could load BVH files, delete the rigs and have a library of Actions stored for use on any character.
当然你也可以加载BVH文件,删除rig并且把它保存成一个动作库存储起来给任何的角色用。
In the following steps I will assume you have a basic understanding of rigging,weight painting and so on in Blender.
下面的步骤中我会认为你有一个关于rigging, weight painting(权重画)的基本知识。
I will only cover the steps related to getting your rig ready for use with mocap data.
我只会大概说一下关于如何把你的rig弄成可以与动作捕捉数据相配合。
And to start, depending on where you get your BVH files, it’s likely
you will have to prep them first.
开始吧,不管怎么地,你得准备一份BVH文件。
One main issue – among others – is the
sample rate.
最重要的问题,相对于其它的是取样速率。
Some BVH files have way too much information – up to 120 frames per second (FPS).
有些BVH文件有太多的信息了,120 fps.
That makes working with the files far too cumbersome, not to mention noisy.
这会使得用这些文件工作起来非常费劲。
We will start by preparing the BVH file for importing well into Blender with a free program called bvhacker.
我们用一个免费的软件bvhacker来把准备的BVH文件导入到blender中。
Step 1
Prepare the BVH file What we want from bvhacker, or any tool you choose, is to make the following modifications where needed:
准备BVH文件: 下面就是我们想要用bvhacker或是其它工具做的修改。
at Frame 1, there should be a standard T-pose with the model at
rest.
在frame 1(第一帧),静止模型应该有一个标准的T-pose.
The hip (root) bone should be centred.
臀(根结点)骨骼应该是在中心位置。
And finally, adjust the Frame Rate FPS. Some files come with 120. I like to work with about 30.
最后调整FPS成30.
In bvhacker, use the Set 1/2 frames in the Edit menu as many times as you need to achieve the target rate.
在bvhacker中可以在编辑菜单中多次设定帧数为原来的1/2来实现这个目标。
Step 2
Import and setup When you import the file, the rig will likely need to be rotated because in Blender, Z is up.
导入与调整:当你导入文件后, rig应该是被旋转的因为在blender中Z轴是向上的。
Do this in
Object Mode so that the Armature object stands up.
在object模式中调理Armature对象向上。
Then line up the
character to the Armature and vice versa.
反之也可调角色成Armature那种方向。
This is very much a back-and-forth process.
这可能要大量的反复。
For the bones, move them in Edit Mode.
对于骨骼,在edit模式中移动。
If a rotation is required, do that to the character limb, rather than the bone.
如果需要旋转,改变角色的肢体,不要改骨骼。
Step 3
Retarget animation To retarget,
重定向动画。
simply copy this rig
(or import a new BVH) and repeat Step 2 with a new character model.
拷贝从BVH中导入的rig并且 对新的角色重复动作2。
You only have to do it once per character and it is simple and fast.
如果你干多了,就会很快了。
To
assign a new animation to any rig, import a new BVH and that new Action
will be available.
如果想把一个新的动画赋给任何的rig, 导入一个新的BVH与新的动作就成了。
Select the rig of your character in Object Mode and, in the Action Editor, simply choose the new Action.
在object 模式中选择你的角色,在动作编辑器中,选择新的动作。
我的总结:就是把BVH中的数据导入成动画数据,然后把这些动画数据弄到你想指定的角色上。
这个角色应该具有与BVH文件的rig相同的rig层级关系。
………………………………………………………………………………………………………………………….
About the artist Richard Culver is a filmmaker and freelance 3D artist with more than 20 years of experience in all aspects of film production and postproduction. See more of Richard’s work at www.richardculver.com