-
Notifications
You must be signed in to change notification settings - Fork 188
Geometries attached to bone have strange transforms #74
Comments
If you have a general question, how joints etc. work in glTF, please create an issue here: Also, I recommend to read the user and developer documentation, as they also can answer your question: Finally, I recommend to read, how rigging is done in Blender: |
Well according to your shot it doesn't work as expected at all, the Knob geometry is not even displayed. |
There are no knobs in the scene file. |
ho ... I messed up again I'm sorry... I always forget to save the blend file... |
The object is assigned to a bone. The mesh has no vertex groups. I think I have answered this question before and this is not supported at the moment. |
But it is nowhere listed :-) |
Oh ok, I thought it was supported because except for this issue it works... :p |
glTF 2.0 does not directly support the feature to assign a node to a joint. |
mhh doesn't it? Doesn't looks like it forbids it though... I'll post an issue in the spec project, this, at the very least, needs clarifications. |
There's the difference: The scene you provided me, the mesh object is still a child of the Armature plus there is a property, where the mesh object belongs to a joint/bone. And this is the tricky part and that's the reason why I provided you these links. It is not a glTF 2.0 specification problem. And the problem is also solvable, but the solution is not straight forward. If you think so, go ahaed and implement it :-) |
Well, I'm not saying it's easy, I'm saying it almost works in current implementation, minus the porper transforms.
My point is, the exporter should not do any assumption on how the information should be interpreted, and export the data as there are in the blender file. |
Please consider this: In this spcific case, the mesh has still the Armature as the parent. So, with your description, if someone wants to render the scene without skinning - it will fail. So, which inverse matrix and/or transformation matrix will you take? The one from the current node or the one from the bone? What is happening, when you animate the armature, the mesh node and the bone? But the exporter is open source. You are free to implement it and make a pull request. |
No you misunderstood what I meant, I'm no saying the blender importer does assumptions, I say it shouldn't. I'm not a native english speaker so sometimes I may sound more blunt than I intended, I'm sorry. Anyway, you are right about the need to convert the blender's larger feature set. I'm not really experienced neither in blender plugin dev nor python, but I can give it a try. |
The only proper solution is to create joints and weights for this mesh and give full weight to the bone it is assigned to. |
Hehe, well I don't agree with that so before diving into the code I'd rather we reach to an agreement. I don't want to spend too much time on it and have my PR rejected. Why do you think, that it's the only proper solution? Why handling it like any regular node would be a problem (child node with local transforms). In jMonkeyEngine, we can handle both solutions, so in the end it will work for us, But the regular node solution is preferable to me as we have a special and optimized mechanism for this in the engine. Alternatively, would it be conceivable to have an option checkbox "Consider object parented to a bone as skinned by this bone" or something along those lines. And support both ways. |
If it is working 100%, I will not reject it. Because the mesh is assigned to a node and the node has the armature as a parent. Additionally, it is linked to a bone. So, animate the armature, animate the meshes node, animate the whole bone. All animations are influencing the mesh - both from the object node and(!) the skeletal bone node tree. That's only possible - from my perspective - if you follow my suggested approach. If you have another solution, please go ahead, I am always willing to learn. The scene has one, exact behaviour. If you export it - saying you are supporting this feature - it has exectly to behave as seen in Blender. Supporting both ways is no option, as it just solves your problem in this specific case. |
@UX3D-nopper could you clarify — Can this not reasonably be implemented? Or is it not a recommended way to use Blender skinning, regardless of the export format? If this is something Blender artists might typically do that the exporter or glTF simply don't support, I think we should do one of several things: (a) Document it. With the issue closed I'm worried that issues like #155 will continue to be common. If the reason for closing is simply that we have no immediate plans to implement it, I'd prefer to have this open as a record. |
Reopening, I think documentation (and ideally a visible warning during export) would be worthwhile, even if no one can get to it right away. |
Tracking this issue on the new project here: KhronosGroup/glTF-Blender-IO#286. |
Hello, I think transforms of an object attached to a bone may be wrong.
consider this example
simple.zip
A simple rigged model. The last bone of the rig has a child geometry (knob). the last bone root is at 0,0,2, and its tip is at 0,0,3.
The knob geom is at 0,0,4 in world space.
If you look in the exported gltf everything is fine for the base rigged geom and the skeleton, and the knob geometry is a child of the last bone as expected, however, its transforms are like this
First, it looks like the translation is taken from the tip of the bone, instead of the root of the bone. Which is a problem because we have no information about the tip in the gltf file.
Also there is this rotation that looks like a Z up to Y up correction rotation, but backward.
I don't know what to do with these transforms, to me they should be
Or any equivalent transforms. basically the local transforms of the geometry relative to the bone root it's attached to.
The text was updated successfully, but these errors were encountered: