Git Product home page Git Product logo

bvhtools's People

Contributors

emilianavt avatar jingjiangtao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bvhtools's Issues

[HELP] Convert Scientific Notation to Number

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!

Import BVH to blender bone position are differents.

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.
QQ截图20210113201158
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.

Wrong position when importing bvh file

Hi,
I found a new issue, with the position of the model when importing the animation.
This is the situation:

  • Take a model of Scale 1 and record an animation and export in bvh.
  • Use the same model with a different scale for example 1.5 (smaller or bigger).
  • The animation looks ok but the model has an offset to compensate between different scales.
    There is something that needs to be corrected in order to make this works but I'm not so sure how.
    Something related with the way you apply the offset of the root bone, when creating the animation (on the loader)
    I'm trying to figure out a way to fix it, any ideas?

Thanks in advance

Problems when using different models to load animation

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.

BVH file import

I imported the motion-captured file I shot myself, It is distorted and played as shown in the picture below.
I want to know if there are any mistakes I made.

The bvh file that I have can be played directly in OpenGL without special editing.
image

When played in Unity, it plays as follows.
image

Camera export from Unity to Blender

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?

Import extracted BVH file at the Maya/3D Max

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?

BVHTools v1.4.3 --- no animator found

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?

Issue with BVHRecording when rootBone is set.

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.

animation malformation

hi, finally I can generate animation, but the result is a bit malformation as follows:

malformation

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!!

The player's base pose is error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.