-
Notifications
You must be signed in to change notification settings - Fork 324
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
Export Armature and Animations Only - Exclude Mesh #822
Comments
Did you try to select only armature (and parents from armature to root of the scene), and export using "Selected Objects" ? |
I tried that before. The animation gets exported but not the armature. When I open the GLTF file, I see the animation element has channels and samples, the nodes for the bones are there too but, the SKIN element is missing. Without that, I do not know the order of the bones to properly export the data to the shader. The only way I can get the SKIN data to be saved to the file is if I also select at least one Mesh thats attached to the armature. So yea. there is no way to just export the Armature and Animations only. I have my own parser, so I would like to be able to just render all the bones and animate them, but without skin element, i'm stuck. |
I understand. |
I'm not aware of any requirement in the specification that a node having a
...which is probably more ambiguous than it should be, and we should clarify it either way. But unless there are side effects I haven't thought of, I believe we should allow a skin to be attached to a node without a mesh. That should be useful for exporting skinning animations in standalone files, as just an animated skeleton. However, morph target / shape key animation would not be valid without a mesh. |
It's in the schema. |
Here's the thing. The Bone Nodes and the Animation all gets exported now. The only thing thats missing is the skin element. Its a root element, all it does is give you the order of the bones plus the Node index for each bone. There is no possible bad side effect of having it included. In all honestly, the way it works now feels wrong. I select armature ONLY to export but the exporter only saves bone nodes and animations but excludes skin which ties the other two bits together. If Skin needs a mesh, then why are Bone Nodes and animations being exported? They're useless without the skin data. Thats a flaw in my opinion. So I think either fix the export to say, you can not export armature+animations without a mesh or just put the skin data in and let it work as an animation asset export. |
I see. This is perhaps worth revisiting in KhronosGroup/glTF#1665 (or perhaps out of scope, I'm not sure). |
I need to export armature + animation to gltf. I have fbx files with the model, and fbx files with only the frame and an animation. Cannot export this files only with armature in GLTF. |
@Snouf-ID some kind of mesh will have to be attached to the armature to export. That could just be a cube weighted to a single bone, I think, and then you'd connect it to the final mesh in another application. |
So, Can someone confirm (or not)? @donmccurdy ? |
@julienduroure It is perfectly valid in the glTF spec to do your second point. (EDIT: Sorry, I misread your post. The first is indeed not allowed, but the second thing you said is) The glTF spec does not state any normative behavior when an unused skin object is encountered, but multiple applications use this as a signal of intent by the user to indicate that an armature is desired rather than a node tree. Here is an example of an XBot avatar with a few animation tracks embedded: You can see here that Three.js, Blender, and Godot already support this de facto behavior. Screenshots at bottom. Finally, you can see here from the validator (screenshot below) that a single Note is created for the unused skin object, but no Warning or Error is issued for this case, as it is legal to include unused objects. @donmccurdy If it hasn't already been done, I would suggest that this behavior ought to be written as an Implementor's Note in the glTF 2.0 specification, given the prevalence of apps that take an unused skin as a hint for an armature to be created. Godot: |
This is my conclusion too, that there is nothing that seems to prohibit it. |
What is the proposed change in glTF-Blender-IO here? Something like:
All of that sounds fine to me. The validator's message that the skin "may be unused" can be ignored safely. We may need to be careful that the skin exported in this case is identical to the skin exported when a mesh is attached — otherwise applications attempting to retarget the animation may run into problems. So, using the same joints, in the same order, with the same inverse bind matrices.
Personally I think I see this as one more example of the general use case of 'unused' resources – unused meshes, textures, and materials are also there for applications to use as data resources rather than directly as part of the scene. But if there's some wording you feel would be helpful, I'd recommend opening a PR – the use case of animations in a separate file is popular enough. |
Hello, Here is my proposition: Currently: To be: |
A PR is available here : #1582 |
Fix #822 Export Armatures without skined mesh
I would like to be able to export only the animations. THe idea is that I export the mesh+armature in one file, then export animations+armature in as other files. I do not want them together in one large file for specific reasons.
The text was updated successfully, but these errors were encountered: