Click it for a larger webm version.Įach row in my benchmark was executed 10 times and then the average amount of milliseconds was calculated.īVH: 22 bones, 1522 frames, 30 fps, 50.7333333333333 sec. bvh file used is for the conversation gestures that you can see animated here to the right, though not all BVH frames are in the ~14.3 FPS gif. I'd like to avoid giving an example since different hardwares under different conditions gives different performance (and benchmarks gets more irrelevant over time as typical hardware improves) but here is an example anyway. It's even faster when not running in the Unity Editor, pretty much doubling in speed in the stand-alone release version of your game. The tool has been written to be blazingly fast, able to import thousands of frames in a very short time. The static method BVH.makeEmpty() will create an empty BVH instance if you ever want to make a. There's also a duplicate() method on each BVH or BVHBone instance to quickly make copies without having to import twice. bvh file's frame rate this will make import time extremely short when set to false. If you only need the rest pose or if you just want to peek at a. Useful for dealing with BVH files exported by Blender.
Interpolation makes it often near impossible to detect any quality loss.Ĭounts z as up instead of y during the import. Very useful because too heavy AnimationClips only waste resources. Can be set to negative numbers to auto-adjust the import percentage to a frame rate. If not 1.0f less than 100% of the available animation frames will be imported. The constructor also has a couple of useful optional parameters, in particular: Just make a BVH instance, call normalize() to center/align/flatten and then cell writeToDisk() to save it as a new. BvhImporterExporter works great as a "raw fix" before fine-tuning an animation in for example Blender.
It's useful if you for example want to make seamless walk/running animations, where you need the skeleton to stay in the same spot but still be able to bob up/down and sway left/right. What does it mean to "flatten" an axis? It makes the animation stand still on one axis while being able to move in the other two. The last flatten call can be skipped by calling normalize(false). The best convenience method is perhaps normalize(), which calls center(), align() and flattenAnimationForward(). Some convenience methods also exist, like center(), which positions both the first frame of the animation and the rest position at Vector3.zero.Īnother one is align(), which rotates the animation so it points at Vector3.forward (or a direction specified by you). Renames the skeleton bones that matches your given names. Removes one or more frames from the animation. Rotates the the animation (with or without the rest pose). Prevents the root bones from moving on a given axis. You can reposition the animation (with or without the rest pose). You can change which frame is the first frame. It can then be written back to disk as a completely new. bvh file can also be modified via several methods or by changing the bones directly via the allBones struct array.
This tool goes great together with the MeshSkinner tool!
Call method to make a GameObject skeleton.bvh files into the Unity 3D Game Engine at runtime. What BvhImporterExporter does is make it possible to import these. It defines both the motion data and the actual skeleton that should be moved by it. Biovision Hierarchy format (BVH) is a popular motion capture format stored in plain text files.