I’ve been trying to make sense of bone rotation limits. Despite working on this armature for quite some time, I had noticed something wrong but not really got to grips with it until today. The bone rotation limits had been noticably quirky, but investigating how they work, they seem to make no sense at all to me. Here’s an example file-
Consider the right thigh bone. It has rotation limits for X, Y and Z (but Z is currently not active). I have rotated the thigh 90 degrees around the X. It obeys its X limit. However, if I now rotate around the local Y- the bone’s “roll”- (key R Y Y) it ignores the Y limit, and obeys the Z limit- which since it is inactive, means it has unlimited rotation. If I rotate around the local Z axis (key R Z Z) it obeys the Y limit! If the X rotation is different, the other local axes obey mixtures of the limits it seems.
In other words, the gimbal it is calculating from is not moving with the bone’s control gimbal. It seems some different mixtures of which axes swap change depending on whether the bone is ZYX, XYZ, YXZ, Quaternion, etc. But I can’t find any where all three limits remain consistent with the actual axes of the bone.
Is there a way around this? Is it a bug? Am I missing something?
I think your problem is that you have applied the constraint in Local Space - so these axes may well be switched. I have changed the constraint to work in Pose Space and it seems to be holding up so far in my checks. This may be the answer, but I am not yet 100% sure.
Cheers. Clock.
Update, I know it sounds a bit perverse, but with the rotation on the bone, its original orientation of its Y axis is Local and global Z so this is I am sure the problem. I will check my logic again to confirm.:spin:
And finally you will need to change the constraint values to work in Pose Space - I will have a go and get back to you.
Thanks Clock, I think it’s meant to be local space as pose space calculates relative to the root bone.
Update, I know it sounds a bit perverse, but with the rotation on the bone, its original orientation of its Y axis is Local and global Z so this is I am sure the problem. I will check my logic again to confirm.
I’m not sure what you mean by this, it’s rotating locally so far as I know. As posed in the example .blend, the only applied rotation is a local rotation around the X axis.
Yes I take your point on local space - I was going round in circles with this! I will try with a brand new armature and get back to you - it may be significant that this bone has a 180 degree roll on it - noticed this when I looked at it in edit mode.
In the view, to rotate the bone about its own Y axis when the bone is upright. i.e. leg on the ground, to rotate the bone about its own Y axis you actually would key R Z 30 for example - this is messing with my head just now!
Just as an exercise, rotate the root bone 90 in Z (its Y axis) i.e. key R Z 90 CR and then operate your leg again - everything is wrong way round now - I am confused, I need to start again with a new blend file I think - did you once have IK constraints on this? I ask because there are settings in the bones IK panel!Later…
OK I have an answer - If you make two bones, one at the top pointing down and one extruded from that. Then apply the same Limit Rotation constraint to both. The top bone obey the limits as seen from Global Axes ONLY - but the second bone applies the constraints as seen from its OWN axes - weird but true - I have recreated this 10 times - same result. So the answer for your leg is to put a small bone at the top of it that it is parented and CONNECTED to - it will then obey the constraints by applying them to its OWN axes.
This appears to be partly explained by this bit of the manual - the bit about the elbow I am looking at:
Update - the top bone appears to need to be hanging vertically when it Edit Mode for this to work. It may not be the correct answer, but it is recreatable.
Just tried again - the top bone does not need to be vertical after all…
Also I just found - if you put a Limit Rotation constraint on your hip bone - I limited all three axes, your thigh bone behaves itself - again - weird but true. You appear to have to limit all three axes for it to behave.
I don’t know what happened here, but when I tried to do this again - it swapped axes again - I am now deeply confused. I then tried rotating the leg just one degree and it started behaving again - seems now like its because the thigh is exactly at 90 degrees.
Clockmender, having given this some more thought it seems to me that this is a problem of rotations in 3-space that I first encountered 30 years ago(!) when I was writing a primitive 3D programme for my Computer Studies GCE (school examination in the UK) which is that by their nature the axes “interfere” with one another so there is no single solution to the question of what axis rotations will move a point from some coordinate (x,y,z) to another (x’,y’,z’). Depending what order the rotations occur in (XYZ or ZYX or whatever) you will get different final rotations. So it seems a constraint can’t work “as advertised” for any 3-rotation in local space, because rotation on one of the axes will always move the other two axes.
So I think the constraint can only logically work as I expect if one of the axes is locked, which is why it works fine on elbows and knees, etc. But on any ball joint, it’s going to have strange results. I think it could work if the constraint had a specific axis order which matched the order of Euler Angles set for the joint (XYZ, ZYX, YXZ etc) so it is applying the constraints in the same order as the rotations are applied to the bone, but it doesn’t have that setting.
I can’t right now think of any way forward other than to not use it.
I’m English too, well English of ancient Danish origin, my ancestors came to England raping pillaging looting and burning, now we are more civilised and confine ourselves to just two items from that list. - I know what a GCE is, having sat them myself a few years before you my friend, although I refuse to specify how many… My findings are broadly in line with yours - lock one axis and it seems to work, otherwise it behaves randomly. My advice, until someone shoots me down in flames - use a driver on the rotation and apply a driver “limits” modifier - that seems to work, although it means rotating the bones by another object - I have experimented with empties and they are fine. You need to set your rotation limits in Radians, but being an educated Englishman I have no need to tell you how to convert from degrees to radians!