Rot limit and IK

Issues concerning rigging & Face Robot...
User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Rot limit and IK

Post by McNistor » 16 Jul 2011, 18:32

Is there a way to impose rotation limit on local Z axis of the 2nd bone in a normal limb (2 boned arm/leg) when animating in IK? For FK this is very straight forward on the kinematics ppg of the bone, but what about IK? Putting a rot limit doesn't help when you're doing IK so what do you think, should I investigate this in ICE or do you know a traditional method?
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Rot limit and IK

Post by Mathaeus » 16 Jul 2011, 19:09

in 'traditional' way, you create a new layer of nulls with same hierarchy, link them to IK chain, create conditional expression - or some creativity with direction constraint (if you 'swap' up-vector and target, you'll get 'one axis constrained rotation'). Something along this line....

In ICE kinematics, probably you'll do the same, but instead nulls, you're using nodes, get-set data...

Anyway, anything complex won't go without 'layering'. Let's say, you can't drive parent's transform by child's transform, but you can drive both parent and child in opposite directions, using some external controller.

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 16 Jul 2011, 21:13

Mathaeus wrote:if you 'swap' up-vector and target, you'll get 'one axis constrained rotation
Can you elaborate on that a little please? What target and what do you mean by "swap"?
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Rot limit and IK

Post by Mathaeus » 16 Jul 2011, 21:52

you can just try this, create cube, create direction constrain to null, use another null as an up-vector. Move nulls, and you'll notice the difference.

hopefully a famous Isner's page about rotations is still alive.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Rot limit and IK

Post by EricTRocks » 17 Jul 2011, 00:15

Setting rotation limits on the 2nd bone works for me.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 17 Jul 2011, 00:29

EricTRocks wrote:Setting rotation limits on the 2nd bone works for me.
you must have a different XSI :P
that or you didn't read this thread carefully :)
edit: OR I'm stupid as it turns out if you continue reading below
Last edited by McNistor on 17 Jul 2011, 01:32, edited 1 time in total.
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Rot limit and IK

Post by EricTRocks » 17 Jul 2011, 00:37

McNistor wrote:
EricTRocks wrote:Setting rotation limits on the 2nd bone works for me.
you must have a different XSI :P
that or you didn't read this thread carefully :)
SI 2010 SP1

Run this, grab the effector and have a whirl.

Code: Select all

# Python

Application.NewScene()
Application.ActivateObjectSelTool("")
Application.ActivateObjectSelTool("")
Application.Create2DSkeleton(-6.25118771807394E-02, 0, -5.00348380103928E-02, 6.18867584089323, 0, -6.32940700823774, -90, 45.1288727277488, 0, 4, "", "")
Application.AppendBone("eff", 13.3900440921144, 0, -7.50522570152823E-02, "")
Application.SelectObj("bone,bone1", "", True)
Application.SelectObj("bone1", "", True)
Application.SetValue("bone1.joint.rotlim_active", True, "")
Application.SetValue("Views.ViewA.TopCamera.camvis.attrselchnjntareaguide", True, "")
Application.SetValue("Views.ViewA.TopCamera.camvis.attrunselchnjntareaguide", True, "")
Application.SetValue("bone1.joint.rotmaxz", -60, "")
Application.SelectObj("eff", "", True)
Application.Translate("", 8.27209190550114, 4.69911679517001, 0, "siRelative", "siLocal", "siObj", "siXYZ", "", "", "", "", "", "", "", "", "", 0, "")
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 17 Jul 2011, 00:51

Mathaeus wrote:you can just try this, create cube, create direction constrain to null, use another null as an up-vector. Move nulls, and you'll notice the difference.

hopefully a famous Isner's page about rotations is still alive.
I know about rotations man, but thanks for the info anyway.
I'm not sure that you understood exactly what my question was seeing your setup with cube and nulls. Or maybe you did understand and it is somehow related and I just don't see how? :-??
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 17 Jul 2011, 00:57

Alright EricTRocks, that works. :)
Thanks!
I need the limit to act when the bones come closer to each other not when they're spreading apart. What should I modify?
I know nothing of Python but I have some C and C++ training so O'll play wiht it maybe I'll figure it out. But you do tell in the meantime please :)

p.s. Hmmm, some interesting stuff on your website man, very very nice!

edit: ok, the -60 value seems to do the trick

another edit: it seems that this can be achieved without scripting, straight through XSI's interface. Should I've known that, I wouldn't had opened this thread. Anyway, it's good for posterity. :)
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Rot limit and IK

Post by EricTRocks » 17 Jul 2011, 01:20

I just gave you a script that reproduced the changes I made in my scene. Select the 2nd bone and hit enter to bring up its Property Page. Look for the "Rotation Limits" tab. There you can adjust those limits on the bone. Change the min/max to suit your needs. Also you should enable the visibility of the joint rotation limits in the viewport options to help you see them while you're editing them.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 17 Jul 2011, 01:37

EricTRocks wrote:I just gave you a script that reproduced the changes I made in my scene. Select the 2nd bone and hit enter to bring up its Property Page. Look for the "Rotation Limits" tab. There you can adjust those limits on the bone. Change the min/max to suit your needs. Also you should enable the visibility of the joint rotation limits in the viewport options to help you see them while you're editing them.
Yes, yes, I've figured it out by now :)
Thanks man.
The problem is that I was using the rot limits kinematics ppg (ctrl+K), forgetting that bones are special objects that dance on their own music.
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Rot limit and IK

Post by Mathaeus » 17 Jul 2011, 10:09

McNistor wrote:
Mathaeus wrote: I'm not sure that you understood exactly what my question was seeing your setup with cube and nulls. Or maybe you did understand and it is somehow related and I just don't see how? :-??
well I'm a lazy to go with full example :) - basically, you constrain a copy of 2nd bone to null (null is up vector of direction constrain) , this null is parented to effector. Then you controll the 'limit' by position of this null.

afaik, small problem with limits in IK chain PPG is, that they can go in conflict with (possible) additional constraints. If you apply an additional constraint, which forces rotation into 'restricted' zone, IK chain become blocked.

User avatar
McNistor
Posts: 605
Joined: 06 Aug 2009, 15:26

Re: Rot limit and IK

Post by McNistor » 19 Jul 2011, 04:03

Please explain.
Most probably I'll use lots of controls and constraints as the limb I'll have to rig is a spider leg with six bones - 2x3 or 3x2 chains. Btw, do you think it's better to have 2 chains with 3 bones or 3 with 2? Or maybe only one 6 bones chain?
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Rot limit and IK

Post by Mathaeus » 19 Jul 2011, 20:29

McNistor wrote:Please explain.
Most probably I'll use lots of controls and constraints as the limb I'll have to rig is a spider leg with six bones - 2x3 or 3x2 chains. Btw, do you think it's better to have 2 chains with 3 bones or 3 with 2? Or maybe only one 6 bones chain?
well, all I can say here, is that I've learned to live without rotations limits in IK chain PPG, sometimes around XSI 4 or 5. Just that. Constraints should be fine.

2 with 3, 3 with 2... 2 bone chain, by it's nature, requires a simple, 'definitive' math. There is only one result. 3 bones or more, requires additional parameters ( preferred angle), result is arbitrary. I'd say, if you can use 2 bone chain, go for it.