Notifications
Clear all

[Closed] Are rotation float limits in Parent Space?

Whilst trying to move away from biped and towards a custom rig, I’ve ran into a few issues with setting up joint contraints.

I want to have a function as such:

fn jointlock jointlimitbone xlockmin xlockmax ylockmin ylockmax zlockmin zlockmax =

This function will take in a bone and apply rotational limits in all 3 axis. I’ve written it, and it works.

fn jointlock jointlimitbone xlockmin xlockmax ylockmin ylockmax zlockmin zlockmax =
(

-- float limit needs to be in radians
jointlimitbone.rotation.controller.X_Rotation.controller = float_limit ()
jointlimitbone.rotation.controller.X_Rotation.controller.upper_limit = degtorad xlockmax
jointlimitbone.rotation.controller.X_Rotation.controller.lower_limit = degtorad xlockmin
jointlimitbone.rotation.controller.X_Rotation.controller.Enable = on

jointlimitbone.rotation.controller.Y_Rotation.controller = float_limit ()
jointlimitbone.rotation.controller.Y_Rotation.controller.upper_limit = degtorad ylockmax
jointlimitbone.rotation.controller.Y_Rotation.controller.lower_limit = degtorad ylockmin
jointlimitbone.rotation.controller.Y_Rotation.controller.Enable = on

jointlimitbone.rotation.controller.Z_Rotation.controller = float_limit ()
jointlimitbone.rotation.controller.Z_Rotation.controller.upper_limit = degtorad zlockmax
jointlimitbone.rotation.controller.Z_Rotation.controller.lower_limit = degtorad zlockmin
jointlimitbone.rotation.controller.Z_Rotation.controller.Enable = on

)

However, I don’t always get the rotation limits I expect – the knees and elbows work, but the feet and toes are offset.

Are they in parent space instead of local?

3 Replies
 PEN

Yes parent, as is anything. Ask your self, if you rotate your self 90deg, what is your local rotation? Answer: 0, since localy you are where you are. Compared to something else you have rotated 90 deg.

Ta!

it was getting to the end of a long day…

I’ll have a go tomorrow at computing the difference between the local and parent rotations – I want to make the function artist friendly so that anyone setting up rigs only ever pass in local rotations.

I reckon…

in coordsys parent prx = thebone.rotation.x_rotation

…will do the trick.

 PEN

Not possible.

Again consider my last situation, what is local? Also you have to deal with gimble lock so any local axis you are looking at isn’t actualy the axes that you are rotating about in all cases. Keys are stored in one way and you can’t change that no matter what tools you create.

List controllers will help some but euler rotations are euler rotations, doesn’t matter what software or what space you are working in. With rotations the parent can be looked at as the previous controller in the list, each is an off set from the previous. With position it is the actualy parent of the object. Each controller in a list adds up as an offset from the previous but the space they are moving in is the parent of the node you are working with.