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
Blender Exporting Animations - Rest Position toggle #5887
Comments
Note (ping @repsac): the Blender exporter is currently being rewritten in the dev branch. You may get very different results with it, maybe you could try the exporter from the dev branch?
Isn't this a bug with the exporter then? Can you describe this problem in detail?
The file on the right has a "Wiggle" animation that contains the rest pose for all keyframes. I guess if you tell Blender to display the rest pose for all time steps, then it will also export the rest pose for all time steps. |
Actually there is another issue with animations I am trying to figure out with the new exporter. The
It seemed more logical to directly query the target object of the mesh rather than blindly iterate over the actions in But this is why the new exporter puts out a single object/dictionary and not an array. I could be wrong in this assumption but that is what we are trying to figure out. |
After this PR #6052 is merged I suggest testing out the changes made specifically to skeletal animations in which you can choose to export either |
Thanks! I'll be sure to take it for a spin. |
It probably isn't wise to mix Pose/Rest. I considered throwing in a check for that but still on the fence about that one. Who knows if someone ever has a really odd scene that requires them to mix the two. I also played with the concept of setting the position based on the
Speed improvements have been addressed (#6031) and there are a couple more parts of the exporter that have yet to be optimized. One thing that is unavoidable is that now the exporter actually uses
were used in the exporter and built JSON entries into a large string that only needed to be written to file. The customized
Also because the exporter builds real Python dictionaries under the hood it gives me a data format that can use for other formats like
Is this the error you're seeing #6050 (comment)? If so then the exporter is indeed checking (#6050 (comment)) and reporting, it just isn't a wrapped into a dialog at this time. If the traceback is something else then it would be an actual error because the exporter would have been trying to parse an armature like its a mesh. I will be adding utilizing something like this It seems like you have a working animation export now. |
All right. I still don't quite understand exactly what is changed by the two Rest/Pose toggles (for Armature and Exporter). At least there is one option that works for me - and many thanks for a re-write! I'm also experiencing strange artifacts on importing these animations on the client side, using the latest dev version of three.js. Some animations will rotate/scale randomly when played, but that's probably best left to another issue. |
Hmm... It seems to come with non-normalized quaternions coming from Blender - apparently Blender allows quaternions have x, y, z, and w values greater than 1! |
These non-normalized quaternions are also exported! Note the "hierarchy": [{
"keys": [{
"rot": [0.0,0.0,-0.0,1.0],
"time": 0.0,
"pos": [0.0,0.856348,-0.0],
"scl": [1,1,1]
},{
"rot": [1.0,0.0,-0.0,0.963587],
"time": 0.133333
},{
"rot": [1.0,0.0,-0.0,18.577267],
"time": 0.283333
},{
"rot": [1.0,0.0,-0.0,0.999611],
"time": 0.483333,
"pos": [0.0,0.856348,-0.0],
"scl": [1,1,1]
}],
"parent": -1
} |
The rest belongs in #6082 |
Well if you're so inclined you could diff the exporter modules from r66 and r67 (that is when the changed happened). You could also read what was said here #5582 (comment) and here #5582 (comment) and see if that makes sense for you. Or just be happy that you have a way to get working animations out ;) |
Good catch on the non-normalized quaternions.
I believe the reason for this is that exporting in pose mode positions the bones to the selected pose. Applying a different animation to these already set bone positions creates distortions. |
Thanks, @repsac and thanks again @titansoftime. Through playing around and studying code, I can hope to develop a clearer understanding of the ins and outs of the exporter over time. |
When exporting a multiple skeletal animations, I find myself needing to export the mesh in the rest position to avoid having three.js to take an already-skinned mesh and apply armature transforms on it again.
I created a separate animation consisting of the rest position just so I could switch to it before exporting, so I could export the rest position. I realized that there is a button in Blender that accomplishes the same task:
However, exporting in that way creates a slightly different, non-functional JSON. Here are the two output files:
https://www.diffchecker.com/qyxn4nxg
The file on the left is the one that works correctly. It was exported by creating a separate rest animation. The file on the right is exported by choosing "Rest Position", and appears to be missing animation data.
It would be nice for the rest position button to work - it would remove the need for a separate animation just for exporting. Visually in the editor, both methods have identical meshes displaying, but export differently.
Also, exporting skeletal animations changes the currently selected animation.
The text was updated successfully, but these errors were encountered: