emilianavt / BVHTools

BVH Tools for Unity
Other
200 stars 27 forks source link

Wrong position when importing bvh file #4

Closed bsgg closed 5 years ago

bsgg commented 5 years ago

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

Thanks in advance

emilianavt commented 5 years ago

Thank you for reporting this issue. Please try if 0b183c86fe79f9f5550bc85ced8b2d640366acc4 fixes this.

Edit: The recorder probably should do something similar for scaled models.

Edit 2: I included a corresponding adjustment to the recorder in 7311981a1a577ae2508ebd3ba905213557d2f064.

bsgg commented 5 years ago

Thanks! Looking forward to try the fix as soon as I can.

While I was waiting for an answer from you I was trying to fix the issue, and I did something similar. On the Animation loader I scaled the position with the target avatar (as you are doing) but I need the scale of the original avatar, so I ended up saving that value in an external file.

I didn't know how to save the scale on the bvh, thanks!

emilianavt commented 5 years ago

Thinking about it a bit more, that inverse scale should probably be applied to all bone positions in the recorder, otherwise a scaled model will look off in Blender.

Edit: Implemented in 81b53f8a4bff1c01984c9578ba23475ba4a3c641.

bsgg commented 5 years ago

I've tested the fix, it works! Thanks

emilianavt commented 5 years ago

Thank you for testing it!

I'll finish up a new release then.