Rot limit and IK
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Rot limit and IK
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
-Thucydides
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Rot limit and IK
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.
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.
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
Can you elaborate on that a little please? What target and what do you mean by "swap"?Mathaeus wrote:if you 'swap' up-vector and target, you'll get 'one axis constrained rotation
The society that separates its scholars from its warriors will have its thinking done by cowards and its fighting done by fools.
-Thucydides
-Thucydides
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Rot limit and IK
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.
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
Setting rotation limits on the 2nd bone works for me.
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
you must have a different XSIEricTRocks wrote:Setting rotation limits on the 2nd bone works for me.
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
-Thucydides
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Re: Rot limit and IK
SI 2010 SP1McNistor wrote:you must have a different XSIEricTRocks wrote:Setting rotation limits on the 2nd bone works for me.
that or you didn't read this thread carefully
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, "")
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
I know about rotations man, but thanks for the info anyway.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'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
-Thucydides
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
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.
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
-Thucydides
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Re: Rot limit and IK
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.
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
Yes, yes, I've figured it out by nowEricTRocks 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.
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
-Thucydides
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Rot limit and IK
well I'm a lazy to go with full exampleMcNistor 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?
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.
-
McNistor
- Posts: 605
- Joined: 06 Aug 2009, 15:26
Re: Rot limit and IK
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?
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
-Thucydides
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Rot limit and IK
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.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?
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.