Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with json pose export / import #317

Open
BerlinAW opened this issue Jan 2, 2021 · 3 comments
Open

Issue with json pose export / import #317

BerlinAW opened this issue Jan 2, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@BerlinAW
Copy link

BerlinAW commented Jan 2, 2021

Firstly, thanks for keeping this project going!

Description:
JSON export system for poses does not properly capture the current pose of the character. It attempts to apply a rest pose (It looks like the standard rest pose) to the character in addition to the actual pose that the user is trying to capture.

I am running on Arch Linux, in Blender 2.91.0, running the plugin off of the master branch that I downloaded from git around December 27th.

To Reproduce:

  1. Finalize a character.
  2. Load a pose from the sample library (Ex: male captured 01)
  3. (optionally) Modify the armature in blender pose mode
  4. Save the pose as a json file
  5. Set the armature back to rest pose (in my case t-pose)
  6. Load the saved json pose
  7. Model will appear to be deformed in a blend of a few poses

Expected behavior
Json pose file should contain similar data on export to the original library file.

Additional context
I am not an expert on python so it is hard for me to diagnose the issue. It looks as if the import def attempts to set the model to a rest pose before applying the data from the json file. Perhaps there is something odd in the logic there.

Example JSON

Below is some sample output from the files for reference.

Original Captured01 First Lines Excerpt
`

   
index00_R  
0 1
1 -1.4901161193847656e-8
2 1.4901161193847656e-8
3 1.1175870895385742e-8
foot_R  
0 0.9962068200111389
1 -0.0259423665702343
2 -0.0029539582319557667
3 -0.08300895243883133
calf_R  
0 0.9906958937644958
1 -0.076245978474617
2 0.10502465069293976
3 -0.04096471518278122
hand_L  
0 0.991430938243866
1 -0.125617116689682
2 0.024668896570801735
3 -0.026011213660240173
calf_twist_R  
0 1
1 9.313224635931761e-10
2 -2.5029294192790985e-9
3 0

**New Export Captured01 First Lines Excerpt**

   
root  
0 1
1 0
2 0
3 1.4210854715202004e-14
pelvis  
0 1
1 1.0430863994770334e-7
2 1.1186100934423848e-8
3 -5.582479545296337e-8
thigh_R  
0 0.9918503761291504
1 0.12605217099189758
2 -0.003925259690731764
3 -0.01812080293893814
calf_R  
0 0.9909215569496155
1 -0.07855662703514099
2 0.09860283881425858
3 -0.04669991135597229
foot_R  
0 0.9947118163108826
1 -0.06774932146072388
2 0.07480131834745407
3 -0.01906389743089676

`

Work Around
Have blender export the posed armature as BVH and then import it using the mb-lab tools.

@animate1978
Copy link
Owner

Hmm I am not sure what is going on, I will have to test this myself

@animate1978 animate1978 added this to To Do in MB-Lab 1.7.9 via automation Jan 12, 2021
@animate1978 animate1978 added the bug Something isn't working label Jan 12, 2021
@econundrum
Copy link
Contributor

@animate1978 where in the code are the import and export functions I can have a look at it, haven't tested myself.

It should be clearing all translations, rotations and scaling ops before applying the pose. If instead it's applying a rest pose that's not the characters original rest pose that would cause such an issue.

@econundrum
Copy link
Contributor

It's ok found the functions, will take a bit of unpicking the way it's done more complex than I had imagined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants