Page MenuHome

x=zero not accepted for a bone tail
Closed, ResolvedPublic

Description

Strange issue, I'm still not sure if it's me who messed something up, or if it's a bug.

I can't set the tail of Bone.034 in the file to zero.
It displays Tail X: 0.000 in the Transform panel, and it's quite close to 0, but not exactly. You have to view along the Y axis and zoom in very closely to see it.

The bone has children (Bone.018, Bone.034_L, Bone.034_R) which are connected, so they should touch the tail of Bone.034, but they don't. They move to the tail of their parent as soon as I go into Pose mode.
If I grab the tip of Bone.034 and try to move it along x, or scale it along X, it moves to unexpected directions.

Originally the armature was a very long chain (for a tentacle), and the bug appeared on Bone.044. After deleting that bone, the bug "switched" to Bone.034. I deleted most of the long chain for more clarity, but I can post the original file too if necessary.

Blender svn r44559M

OpenSUSE 12.1
KDE 4.7.2 r5

Details

Type
Bug

Event Timeline

Update: Found a way to recreate the situation from scratch. Seems to appear with large Y and small X or Z values for Tail

1. Create a new armature (one bone) at 0/0/0. Display as stick (the bug is best visible then).
2. Go into edit mode.
3. In the properties panel (N) for Tail, type Y=200, Z=0.2
4. View along the Y axis (num 1) in an orthogonal view (num 5) and zoom in very close, so that you can recognize the Z=0.2 in the viewport.
THE BUG:
5. Grab the tail of the bone and try to move it (G). It jumps into strange places, and it's impossible to move it towards x=0,z=0 or back to its original position.
6. The 3d manipulator disappears when the tail is selected.

No such bug with X=200 nor Z=200 (and the other coordinates 0.2 and 0.0)
Appears also with X/Y/Z = 0.2/200/0 or 0.1/100/0.
The bug seems always to appear when trying to move the tail inside a XZ circle which has radius below 0.1% of Y (see attached image longbone.png).

I'm also attaching longbone.blend which illustrates step 4.

Blender svn r44881M (with factory settings).
OpenSUSE 12.1
KDE 4.7.2 r5

appears also on:
Windows 7 (64 bit), Blender r44807 from graphicall.org
Windows 7 (64 bit), official Blender 2.62 from blender.org

This seems like a precision topic… will investigate this!

I had a quick look at this a week ago, and it seems what is causing the mismatched bone ends in edit mode is that get_matrix_editbone gives a different matrix than the one in pose mode. Did not check it further though, it may well be that it's just float precision issues that is causing the difference, but it also seems that this function computes the matrix in object space while for pose mode it's done in parent space.

Hmmmm… I’m pretty sure this is a drawing artifact:
* It only happens when the bone is *exactly* aligned with the Y axis of the object (to be precise, when the tail is less than 1/1000 of bone length away from that axis).
* It does not affect the actual position of the tail itself (not even the drawing of the manipulator, which is correct – and done in object space), only the bone drawing itself. This means it has no effect over the Pose evaluation (deformation of a mesh, etc.), only on where the tail of the bone is drawn…

That precision problem is probably caused by the fact that the bones are drawn into their own space (meaning that head is always drawn at current space’s (0,0,0), and tail at (0, 1, 0)). This involves several OpenGL matrix multiplications, so I guess the loss of precision is multiplied as well?

Anyway, thing is, there is no easy way to solve that, imho. OpenGL (graphic cards) do not handle doubles. The only solution would probably be to change all bone drawing code to make it work directly in object space… But I really doubt such a small glitch is worth spending hours and hours searching a way to fix it, without even the assurance that there *is* a fix… Will ask devs more skilled in OpenGL, on irc. ;)

Well, in the end, was indeed a visual-only precision bug, but not caused by OpenGL limitations, but by a threshold value in vec_roll_to_mat3(), due to bug [#23954].

Should be fixed in r45103 (in fact, there is still a small gap when you are *very* near Y axis of the bone – but it’s hardly noticeable (previously, it appeared at 1×10⁻³ of bone length from Y axis, now it’s at about 3,25×10⁻⁷…).

Thanks for reporting!