-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Three JS exporter exports "active" keyframes for all frames #6751
Comments
I will add something that may or may not be relevant. When I export, I selected the mesh in blender in object mode before exporting. With the older exporter, I exported after selecting the armature in object mode. Could that matter? What is the correct option? Tested in blender 2.71 and 2.74 Exported with r71 - https://github.com/beiller/gameplatform/blob/master/gizmo_thunder_ffmodel_upload.json Exported with r68 - https://github.com/beiller/gameplatform/blob/master/gizmo_thunder_ffmodel_upload.js Code that imports the mesh: Code that updates animation frames: |
Try setting armature to "rest" mode and also selecting "rest" on the skeletal animation option in export ui. This works for me. |
I tried that and it worked for me as well... :) Now I think this issue may have turned into another already existing issue. Thanks @titansoftime |
I guess its still an issue. When exporting in POSE - POSE mode it exports the same keyframes for the active actions for all the actions. |
Yea, that's why I never do that. |
Great for you. I read the source code of three js and the plugin, because there was no documentation, and I could not figure this out. What is the point of the POSE selection at all then, or any other combination of those settings. Maybe we can set the armature to REST position and get rid of this selector in the export options? I know that someone had difficulty accomplishing this task. Would the following solution work? |
Because we haven't been able to get one type of animation export to work with everyone. Animation exports were changed somewhere around r68. While this "fixed" animation exports for some, but broke for others. This is why during the refactor we implemented the toggle. We tried to update the armature based on the exporter settings in this function Currently that logic is commented out. This is because it does not work in batch mode like it does when the gui is open. There has been talk about setting a rigging/animation standard. But the work I did had nothing to do with rigging or animation (and I haven't rigged in over 10 years and when I did it was in Maya). I am on a doctor ordered restriction in keyboard use because of bad RSI in all my finger joints so my computer time is extremely limited over the next few months. If you understand how Blender handles animation data but don't understand the add-on's logic just ask. Basic overview of the add-on hierarchy down to where animation data is parsed. Rough documentation on why it is broken down like this (as opposed to one huge pita monolithic module) |
Appreciate the info repsac! When I encountered my issue I started to wade through the blender exporter source code to see if I could fix the issue. I did not spend a lot of time, however I can definitely take another look as I have done lots of blender python scripting before. What is the animation / rigging standard you speak of? Are you suggesting a standard rig for THREE? I would advise against this for sure. :) I saw how one of the _rest_bones and _pose_bones function are dynamically passed in as a variable. It was a bit confusing to read FYI. I'll take a look at the code when I have some time. I also think many problems are cropping up because there is no guidelines for usage. In blender - do we use armature modifier, or do we parent the mesh to the armature object in armature mode, or parent the mesh in object mode with an armature modifier, or without the modifiers, and other options. Do we select the mesh, select the armature when exporting? There are many possible combinations as you can see and involves a lot of trial and error to get it working. Cheers! |
Correct. There should be a convention so the code knows what to expect so that predictable results can be had. I don't think a strict one is needed, but many people I have encountered rigged their assets based some random tutorial they found in google searches.
Just ask whenever, I can point you in the right direction.
Good question. It sounds like users have multiple ways of shooting themselves in the foot with rigs. Different approaches can be the result of specific needs but I have encountered people rarely know the exact approach and just do with what ever seems to work (a word I will use loosely).
Select the object. I never got around to inserting
|
Here is how I dealt with the problem. I don't have the python skills to modify the exporter, but I hope it helps in recognizing the problem. Today I spent 6 hours on it (then I realized I had already spent the same amount of time a week ago and simply forgot how I solved this. So if the following doesn't help any one, consider it as a note-to-self): I make an action, which contains one frame, keyframed as same as the rest mode and export it with "pose" selected in exporter's settings. If don't do that, the pose is applied to the posed form of the first frame. So it doubles the armature influence.
True, my model was from makehuman. That's why I think the rigging should have been pretty standard. But I must say, the exporter does an amazing job in understanding all the influences. I even keyframed a value in an armature constraint and it wasn't a problem, like, wow! |
There is a possible workaround / fix for this issue in #6050 |
The JSON Blender exporter has been removed with Also see: https://threejs.org/docs/#manual/introduction/Loading-3D-models |
Hello,
I tried testing every combination of setting with the new THREE js blender exporter (r71 and dev branch)
The exporter exports all animations fine with the correct number of frames per "action", but the keyframe data for all animations written to the json is the keyframe data for the current "active" animation in the action editor (truncating the frames if the animation is shorter, etc).
I reverted to r68 exporter and the .js file exports the animation data properly.
The text was updated successfully, but these errors were encountered: