emilianavt / bvhtools Goto Github PK
View Code? Open in Web Editor NEWBVH Tools for Unity
License: Other
BVH Tools for Unity
License: Other
Hi Author, First of all, great thanks for awesome project.
I am trying to import bvh file that was created in python3.
Python3 automatically convert numbers that has a lot of decimal numbers to Scientific Notation such as "-1.25358e-05"
When I import my bvh file in Unity, it gives me following error:
ArgumentException: Failed to parse BVH data at position 9638. Expected channel value around here: 4.8479 1.2379>>>9e-<<<06 -2.59538e-
I am trying to convert all the scientific notations(they are like thousands) to number in BVHParser.cs script myself, but I am struggling from doing it.
Can you give me any direction for achieving my goal?
Many Thanks!
hi, I made a demo according to the tutorial video(https://www.youtube.com/watch?v=DM7UZuAgBJk)
but where can I find the 3D model named EmilianaCecil?
The description of the tutorial video said:
Cecil-chan's character creation tool can be found on Fantia
But how? what's the detailed steps?
Here is my case.
I convert MMD VMD animation in unity.
Then i record the animation to the bvh file.
Import the BVH to blender with same fbx then the character hand and leg doesnt have any motions.
Also the BVH animation hip and spine is higher than the FBX i import to blender .
Because i import the FBX in blender every bone will stay in position(0,0,0).
But the bvh animation will follow the unity transform position to record.
So theres two question i want to ask is anyway to make the transform position is same as the blender base start with (0,0,0) to get indirect motions.
The other question is why the hand and leg doesnt move.
I already using lot a method to make MMD work in blender with using unity skeleton.The one is most close to work.
Dear Emiliana,
Great work.
I am working on speech-driven gesture generation (speech2bvh), if I want to try your tool to generate humanized animation using my bvh, not sure if it is do-able please? Where can I download EmilianaCecil (is it free to download pls?)
Attached please find my BVH head:
head.txt
Thanks so much!
Hi,
I found a new issue, with the position of the model when importing the animation.
This is the situation:
Thanks in advance
Great tool! It works nice and it is saving me a lot of time.
I think I found a mistake on your code but I'm not so sure.
I am testing you tool with models from mixamo website. So far so good, I was able to export some animations, check them on blender, and reproduced in unity at runtime.
But I have some problems, I am tryingo to use different models with a Humanoid configuration.
My idea is to record with 1 model the motion capture and use a different (or several) model to play the animation. Eveytime I record I use the option enforceHumanoidBones, to record with humanoid unity bones.
If I use the same model to play the record, it works, but with different models is not always the case. I don't know if this has a solution.
Now, one of the things I saw on your code, is what I think a small bug.
the function buildSkeleton, on BVHRecorder script, when you are creating the skel tree with the possible bones, you are not taking into account if someone whants to use enforceHumanoidBones.
In some cases there are extra bones on the bvh file that are not suppose to be there.
Reading your code I know you are adding those bones withouth checking if they are humanoidbones.
I know this happens because I tested with one of the models from mixamo and in the exported file I had the bone Neck1 which is not part of Unity HumanBodyBones enumerated
I hope this helps to improve the tool.
Hi,
Thank you for the tool :)
you were able to export the bvh file for Blender.
However, could you explain how you would export the position and rotation of the camera in unity to blender?
Hi.
I imported the extracted BVH file at the Maya and 3D Max. but It occurred import error.
Is there a way to extract the bvh files that can be used in Maya, Motion Builder and 3D Max?
Great tool.
Hi, I stumble into this problem, in TARGET AVATAR entry, I can't find any animator despite I have several. I'm quite new to unity3D, to my limited knowledge, is it related to the Unity3D version(I'm using 2018.4.6), or have I made some stupid mistakes?
This is a great tool, thanks for sharing it.
I am going to use this tool for recoding avatar motion and export is as bvh file. In the editor I was setting the avatar and the root bone. For setting the bones I pressed the editor button. In the list all bones except the root bone appeared. With missing root bone in the bone list, all bones below (here the legs) were not exportet.
Adding the root bone manually into the list creates a good resut.
My question is now, why is the root bone not in the list. Is that on purpose? This happends in the function below.
public void getBones() {
getTargetAvatar();
if (enforceHumanoidBones) {
populateBoneMap(out boneMap, targetAvatar);
}
List<Component> meshes = new List<Component>(targetAvatar.GetComponents<SkinnedMeshRenderer>());
meshes.AddRange(targetAvatar.GetComponentsInChildren<SkinnedMeshRenderer>(true));
HashSet<Transform> boneSet = new HashSet<Transform>();
foreach (SkinnedMeshRenderer smr in meshes) {
foreach (Transform bone in smr.bones) {
Debug.Log("smr.bones: " + bone.name);
if (rootBone == null || (bone.IsChildOf(rootBone) && bone != rootBone)) {
if (enforceHumanoidBones) {
if (boneMap.ContainsKey(bone)) {
boneSet.Add(bone);
}
} else {
boneSet.Add(bone);
}
}
}
}
bones = boneSet.OrderBy(bone => bone.name).ToList();
}
For my particular case I had to change the if-condition, which is checking for root bone.
hi, finally I can generate animation, but the result is a bit malformation as follows:
fbx file:
https://drive.google.com/file/d/11q5jgAxXPMW-0uSVvlJSqWhIMOaNuS5h/view?usp=sharing
bvh file:
https://drive.google.com/file/d/1V2MDGAKx7B5dUGBIE3lZVH_fMsfTEugA/view?usp=sharing
mapping code:
if (nameMap == null) {
if (standardBoneNames) {
Dictionary<Transform, string> boneMap;
BVHRecorder.populateBoneMap(out boneMap, targetAvatar);
nameMap = boneMap.ToDictionary(kp => flexibleName(kp.Value), kp => kp.Key);
nameMap.Add("spine1", nameMap["chest"]);
nameMap.Add("spine2", nameMap["upperchest"]);
//nameMap.Add("spine3", nameMap["upperchest"]);
nameMap.Add("neck1", nameMap["neck"]);
nameMap.Add("pcube4", nameMap["neck"]);
nameMap.Add("rightarm", nameMap["rightupperarm"]);
nameMap.Add("rightforearm", nameMap["rightlowerarm"]);
nameMap.Add("leftarm", nameMap["leftupperarm"]);
nameMap.Add("leftforearm", nameMap["leftlowerarm"]);
nameMap.Add("rightupleg", nameMap["rightupperleg"]);
nameMap.Add("rightleg", nameMap["rightlowerleg"]);
nameMap.Add("leftupleg", nameMap["leftupperleg"]);
nameMap.Add("leftleg", nameMap["leftlowerleg"]);
nameMap.Add("leftforefoot", nameMap["lefttoes"]);
nameMap.Add("rightforefoot", nameMap["righttoes"]);
nameMap.Add("righthandthumb1", nameMap["rightthumbproximal"]);
nameMap.Add("righthandthumb2", nameMap["rightthumbintermediate"]);
nameMap.Add("righthandthumb3", nameMap["rightthumbdistal"]);
nameMap.Add("righthandindex1", nameMap["rightindexproximal"]);
nameMap.Add("righthandindex2", nameMap["rightindexintermediate"]);
nameMap.Add("righthandindex3", nameMap["rightindexdistal"]);
nameMap.Add("righthandmiddle1", nameMap["rightmiddleproximal"]);
nameMap.Add("righthandmiddle2", nameMap["rightmiddleintermediate"]);
nameMap.Add("righthandmiddle3", nameMap["rightmiddledistal"]);
nameMap.Add("righthandring1", nameMap["rightringproximal"]);
nameMap.Add("righthandring2", nameMap["rightringintermediate"]);
nameMap.Add("righthandring3", nameMap["rightringdistal"]);
nameMap.Add("righthandpinky1", nameMap["rightlittleproximal"]);
nameMap.Add("righthandpinky2", nameMap["rightlittleintermediate"]);
nameMap.Add("righthandpinky3", nameMap["rightlittledistal"]);
nameMap.Add("lefthandthumb1", nameMap["leftthumbproximal"]);
nameMap.Add("lefthandthumb2", nameMap["leftthumbintermediate"]);
nameMap.Add("lefthandthumb3", nameMap["leftthumbdistal"]);
nameMap.Add("lefthandindex1", nameMap["leftindexproximal"]);
nameMap.Add("lefthandindex2", nameMap["leftindexintermediate"]);
nameMap.Add("lefthandindex3", nameMap["leftindexdistal"]);
nameMap.Add("lefthandmiddle1", nameMap["leftmiddleproximal"]);
nameMap.Add("lefthandmiddle2", nameMap["leftmiddleintermediate"]);
nameMap.Add("lefthandmiddle3", nameMap["leftmiddledistal"]);
nameMap.Add("lefthandring1", nameMap["leftringproximal"]);
nameMap.Add("lefthandring2", nameMap["leftringintermediate"]);
nameMap.Add("lefthandring3", nameMap["leftringdistal"]);
nameMap.Add("lefthandpinky1", nameMap["leftlittleproximal"]);
nameMap.Add("lefthandpinky2", nameMap["leftlittleintermediate"]);
nameMap.Add("lefthandpinky3", nameMap["leftlittledistal"]);
} else {
nameMap = new Dictionary<string, Transform>();
}
}
renamingMap = new Dictionary<string, string>();
boneRenamingMap = new FakeDictionary[] {
new FakeDictionary() { bvhName = "Spine3", targetName = "mixamorig:Spine3" },
new FakeDictionary() { bvhName = "LeftToeBase", targetName = "mixamorig:LeftToe_End" },
new FakeDictionary() { bvhName = "RightToeBase", targetName = "mixamorig:RightToe_End" },
}
any advice will be appreciated!!
I seem to be receiving the following error when I try to save motion data: "Motion data can only be saved while the scene is running." Although my scene is playing as I use it so I'm not sure what to do to try to fix it D:
Hello, thank you very much for sharing your plugin. I used the latest version of the plugin (BVHTools v1.4.0), other functions are satisfactory, but the animation' basePost seems to be a problem. When playing, the whole model visually measured the basePost will be negative rather than zero, that is to say, although the coordinates are (0, 0, 0), but the model is down to the floor,Haha
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.