PDA

View Full Version : How can I tame this IK chain?



Manowatt
05-05-2005, 03:12 PM
Disclaimer: I rarely use IK so I'm a bit rusty. This is a problem that I've encountered before, but this time I have to actually solve it...

I have an model of a robotic arm with seven segments (plus a stationary base). The arm has another model (MPLM) on the end that needs to be moved from point a to point b. In the image below, point a and b are represented by the wireframe stand-ins.

I have my arm set up with an IK chain and my module is the last child in this chain. I'm using a null as a goal for the chain, and everything is moving beautifully.

Now my problem: How can I precisely place my MPLM module where it matches the two stand-ins? Frame one would be the closet position to viewer, and frame x would be the furthest position from viewer.

I can place my null in the exact spot where I want the MPLM, but I can't control the precise rotation of the module to match the stand-in. I guess I should be using some combination of IK and FK, but I'm not sure what that combination is.

Any help is greatly appreciated!

_b

I'm also attaching a shot of my scene editor just in case the hierarchy offers any clarity.

Surrealist.
05-05-2005, 03:52 PM
Are you in V8? If so would not IK booster be the ticket? You can just set the position of the final object at the end of the chain. and the arms will follow. Also you can havfe various controls at each joint.

And if you followed another recent thread, I hate to belabour this but Timothy Albee's LW 8 Character Animation book covers IK FK and Ik booster pretty well.
From what you have there it looks like you are asking IK to do too much.

And I don't like to comment much on somthing I have not done alot of so I will stick my neck out and say that in Tims book he talks about only asking IK to do two or three rotations at most. So I guess a combination of IK and FK might be an answer, but I really think IK booster would be a nobrainer.

Beyond that someone with more experience than I can debug it for you.

BTW, you may not have much use for character animation but just his general rules on IK would be worth the price of the book I think.

PS: Just realized looking at your screen you have 8.2 If that is the case IK booster is the ticket.

Manowatt
05-05-2005, 06:55 PM
Okay, lots of valid info there. Perhaps I am trying to make IK handle too much. I took a look at IK Booster, but it looks to be more complex than what I'm used to working with in IK. Reading through the documentation left a lot of questions unanswered. I'll have to take a closer look at it tomorrow when I get back to work on this beast.

_b

Surrealist.
05-05-2005, 08:34 PM
Actually looking back IK booster is only for bones. I thought you copuld use it in a chain of objects. There you go.

But if you could set up bones in those arms (as one object) so they would rotate at the joints, I don't know. It will get tricky wioth bone influence so I don't know. Weight mapping mught work but I don;t know if this is starting to get more complicated.

But in any case IK booster is easy to set up. With a base object that has a string of child bones parented to a base bone all you do is go to Modify/Tools/activate IK boster tool and then with the object selected right click on it in the viewport and activate IK boost tool. Simple, then you can start draging the tip bone around and you'll see what I mean how you just place it where you want and to would make that kind of thing easy.

Otherwise, simplify the chain with IK and FK or figure out how to do it with bones are the ideas I have - for better or for worse.

cgbloke2004
05-05-2005, 08:59 PM
TBH, for something like that FK would be your fastest bet.

work in creating your extreme positions first - ie. the positions where oyu want you pods to be, and then work backwards [or rather, inbetween] to get the animations inbetween your pod locations.

IK Boost would be an idea - you can weightmap/bone your arm segments, and then use IK Boost on them in that way.
with IK Boost you can set the extreme poses you want, and work backwards/inbetween in the same way, only it'll be more fluid than just FK'd [but you can switch in and out of FK/IK in IK Boost iirc].

Dodgy
05-06-2005, 04:44 AM
You can use IK booster for objects too.

Surrealist.
05-06-2005, 05:42 AM
I thought so. Then I went and misinterpreted something I read. Also I forgot there are all these sample scenes.

Defintely check this out and look at the scenes in the Ikbooster folder. There's one with a mechanical arm - image below. Works like a charm!

Thanks Dodgy!

Surrealist.
05-06-2005, 07:20 AM
OK I 've been messing arounbd with it a little. I thought this was a no brainer and it is. If you have your pivot points and hierarchy set up-which you do- all you will have to do is click on the Ik Booster tool, then right click on the selected base object and select Apply Ik Booster. This will set up all the chains as is and you just click on the end object you want to place, put it there for that key frame and you are set. Everything will follow. You can also individually pose other parts of the chain too. You can simply set up your key poses and tweek from there. You can also say fix the end piece once you have it in place and tweek the other parts of the arm if needed. Pretty cool!

This is a powerful tool with all kinds of features but it is useable "out of the box' like this.

Two immediate things you will have to know are the two areas to right click on to edit the pivot point of the selected object in the chain. One is the circle and the other is the numbers that represent rotation. You can right click on the numbers to lock certain rotations - as well as other things. If you right click on the red circle you can fix that item so moving the others don't drag it around.

For instance the base satalite. You might not want draging the arms to move it around. (or end piece once set) Then some of your arms might need fixed rotation on a particular axis.

One last thing is you should read the manual about the keyframing because it does it in it's own on a bar at the bottom of the interface. So editing the keys is different.

Other than that you should be good to go.

Big relief to me because I was planning to use this alot, which is why I got interested.


Picture below.

Edit: I know you are on a Mac, (right clicking) but you know what to do.

Manowatt
05-06-2005, 07:59 AM
Thanks for info everyone. I'll be scrapping my old IK rig and digging into IK Booster today.

Surrealist - I had no idea about the sample scenes (I never loaded the content from LW8), so thanks for pointing that out.

_b

cgbloke2004
05-06-2005, 08:09 AM
I must admit i am daft in the wee hours.
I used ik booster on a segmented robot project a couple of months back.. doh!

Dodgy
05-06-2005, 10:43 AM
Thanks for info everyone. I'll be scrapping my old IK rig and digging into IK Booster today.


It's definitely worth a bit of effort into looking into it....



Surrealist - I had no idea about the sample scenes (I never loaded the content from LW8), so thanks for pointing that out.

_b

Always always ALWAYS look in the example scenes. There's quite a lot of info, even if sometimes it's hidden away. Very often I've figured some tool out from looking at them. :)

Manowatt
05-06-2005, 11:35 AM
Ok, I've abandoned my old rig, and I'm now using IK Booster to control the chain. Everything is working beautifully (and it was much easier to set up), but I still can't figure out how to precisely place the location of the module. Is there any way that I can just type in the actual position and rotation of the object so that the rest of the chain will just adjust itself to accommodate?

Surrealist.
05-06-2005, 01:34 PM
Kind of stumped on that one. Hopefully someone will have some input.

Have you tried using a quad viewport set up and just manually aligning in top side and back views like in modeler?

Manowatt
05-06-2005, 02:06 PM
Yeah, I've tried to just eyball it, but I'm not getting the accuracy that I need. Not to mention it's incredibly tedious to try and position the object like this. :confused:

Surrealist.
05-07-2005, 01:35 AM
I don't know man. Well at least we you got a better rig.

I had a crazy idea though, maybe just half baked, but how about doing it in reverse?

Luckily you have only one arm to move looks like. This idea would require reseting the hierarchy in reverse but you could keep the pivot points.

You have three basic positions and it looks like you have objects set up for this thing to match up to in the two important positions.

If you make that drum object the base object and simply fix the satelite at the end of the chain so it does not move and keep the drum object unfixed you could just do it in reverse. This would mean that the arms inbetween would have to comply to the position of the base object which you would actually be able to control in XYZ space rather than a series of rotations that ad up to an ZYZ movement.

This would allow for precise positioning

Sorry I'm not at my workstation or I'd try it. I'll be back in a couple of days. But do you get how this would be?

You can rotate the base object too if needed and again the tween arms would have to update.

As to animating the satalite through space if needed, you would just move the base drum object and the chain- satalite included- would follow. I really don't know the entirety of the scene so forgive me I am guessing but it looks like a simple simulation so this might be workable.

Crazy enough but it actually might be worth a shot.

SplineGod
05-07-2005, 03:22 AM
IK boost is partime time IK and is designed to blend with LWs full time IK. Full time IK takes precidence over IKBoosts parttime IK. The channels that are not controlled by fulltime IK can be controlled by IK boost at the same time. With full time IK just the goal objects are keyframed. With partime IK the bones or objects in the chain get the keyframes.
On your robotic arm you need to make sure that the rotational channels that each joint cant rotate in are locked.
With LWs IK you have to designate an anchor and end effector which define the IK chain. The beginning of the IK chain is set by "unaffected by IK of decendants" and the end of the chain is the bone or object that is assigned to a goal. Those pretty much stay fixed that way. With IK boost the IK Stop function is roughtly the equivalent of unaffected by IK of decendants in LW. Each controller after the IK stop is basically a goal. The difference is that you can turn IK Stop on and off or even change it on the fly and it doesnt affect the keyframe data. You can turn FIX on and off on the fly as well without affecting the keyframing. This takes awhile to wrap your brain around. IKBoost is also as much (if not more so) of an animation system as much as it is a rigging one.

The easiest way to position those modules is to have one always at the end of your robotic arm and have the other two modules already at their start and end positions. Use the object dissolve tool to pop each module in and out at the right time to make it look like the arm is moving them around. Its a lot easier then anything else. :)

Manowatt
05-07-2005, 08:43 AM
Surrealist: Reversing the chain is probably the one thing that I've yet to try. When I get back to work Monday I'll give it a shot. I'll let you know how it goes.

SplineGod: I couldn't agree with you more, IK Booster is a little hard to wrap your brain around (mine at least). I do have all of my rotations locked accordingly, and I've got my base object set with IK stop. Your point about the object dissolve is exactly what I want to do. My problem is that I can't precisely place the base of the chain (on the space station) and the end of the chain (the barrel shaped module). I can easily get the base to the right location and lock (ik stop) it there, but when I start trying to then position the module in its spot I get stumped. Using the move tool within IK booster just moves the object independantly of the chain, and trying to "freehand" it into position just isn't working.

The fix function is nice in that it prevents the module's pivot point from moving, but the object still rotates around its pivot. The more I think about this the more I get confused. I need a day off. I'm going to go do some yard work now and try to forget about this for a few hours. :D

Surrealist.
05-07-2005, 09:24 PM
Surrealist: Reversing the chain is probably the one thing that I've yet to try. When I get back to work Monday I'll give it a shot. I'll let you know how it goes.

OK sounds like a plan and have fun with the yard work!

BTW, thanks for jumping in Larry, blind leading the blind here, the help is appreciated.

Manowatt
05-09-2005, 12:49 PM
Well, I'm convinced that I just can't lick this one. Perhaps I'm going about this completely the wrong way. I'm posting a dumbed-down version of my scene and model. If anyone has the inclination, feel free to take a look at it.

The rig is set up and ready to manipulate (all of the appropriate axes are locked on the arm as well). See if you can precisely place the MPLM on the end of the arm into the two place holder positions (one at frame 0 and the other at frame x). The base object is placed on the hull of the ISS (not shown) and should not move at all.

If anyone can do this, please share your process! I'm going to go take some aspirin. :D

_b

Surrealist.
05-09-2005, 03:22 PM
I downloaded your file and I am probably not the most qualified person here for this subject but I feel challenged. So I am messing with it a bit. Hopefully you'll get a guru to pick up on this. In the mean time I'll play with it.

Surrealist.
05-09-2005, 04:18 PM
IK BOOST NULL

The scene crashed Layout when I reversed the order and tried to invoke the IK boost tool. I don't know why that would be.

I created some of my own test objects and scene just to simplify and found I could move the base object as predicted but the following peramiters must be present:

NOTE: keep in mind that selection in the IKboost tool is real strange (on my system anyway). There are times when the Base object is actually selected and moving as predicted but the adjacent arm is outlined. I found a place next to the circle to click on to get the proper selection/operation of the base object -the arm still appears selected. Also times when the base object is outlined it is not ptoperly selected i.e. not moving as predicted. This is not always the case, sometimes it is outlined and moving correctly! (There might be a logical reason for this "appearent" abnormal behavior I do not understand just yet.)

At the end of the chain - this would be your current base object as in the scene you provided- you have to add a null and parent it to the end object in the chain. Just think of this as a duplicate of that end Base object. I did not add a null I actually used the end object in the chain, but I suppose you could use a null for this. To simplify the understanding of this concept you could simply copy and paste that "base object" i.e. the stable unmoving object that is now at the end of the chain that has been reversed, into another layer. In layout leave one off the parented chain and keep it visable. Make the other invisable and put it on the end of the chain.

Set it's peramiter to "fix" but DO NOT select IK Stop.

This will fix it's location is space but allow it to spin freely as a part of the IK chain. It will be invisable so it will appear as if the next arm- or conecting point- is rotaing from the fixed pivot in the "base object" which is now not even a part of the IK chain but just stationary in 3D space.

With these peramiters set, the cylinder object (actual base object now) can be moved in 3d space and positioned using quad viewports with precision and exact control - though to my knowlege not numeric - and the arms will update.

This all said of course assuming you can figure out the selction nightmare and if your scene was crashing too I dont know.

I would suggest mocking up a simpler scene to get an idea of how it should be able to work first and then revisit your more complex scene with somewhat of a better idea.

Now all of that said, your scene might just be too complex for this though I don't know why that would be, it seemed pretty straight forward.

Keep in mind too that you can move other parts of the cain that are further away from the cylinder if needed without necessarily affecting the cylinder's position, which is not the case the other way around.

I know there are some other features in IK boost too I am un aware of. But this is real simple and it should work. Also look at the IK Boost clamp scene. It has the clamps moving from one set position to another.

Well that's all for now. I'll let you know if I can get your scene moving.

Surrealist.
05-09-2005, 07:38 PM
Something I am not getting about IK booster frames.

The first three pictures below show my move to demonstrate getting the cylinder object from point A to point B in a straight line. Easy to do. The Base object moves along and the arms update - see post above.

The second picture shows the midway point.

The fourth picture is the result of moving the slider after the boost tool has created the frames at the midway point. The arms did not do what they did when positioning. Now they have made up thier own path and move around. The end object will not stay fixed and instead sort of circles. You can see it fall below it's earlier fixed position.

This is the case in all of the key framing modes : Current Item, Child, Parent, Child+Parent and All Items.

Editing the TCB peramiters in the graph editor didn't fix either.

There is obviously something I am missing here.

Dodgy
05-09-2005, 08:20 PM
IK boost is kind of a blend between traditional IK and FK. It's a lot like IK without Full-time IK on, in that the IK will work while you're manipulating it, but when it's being interpolated between keyframes it'll behave like FK, and may 'wriggle'
You can use what are called bake spots to get around some of this.

Bring up the Dope track when you're using the IKB tool. With your 'hand' selected, right click and drag out the area you want the BakeSpot to be and in the right click menu click 'Set Bake Spot'. The Bake spot is the period during which you want the 'hand' to lock in position.
A cyan area will appear along the dope track.

Go to the IKB Menu in the lower right, and enable 'Auto bind'. Now your locked hand should stay in position in that part of the timeline. When you start moving your parent around again, it may start to wriggle, and you'll notice when you first select it it may show extra keys. This is okay. Just go to IKB Menu>Commands>ReBindMotion All, and it'll fix the motion of the object.

This way you can get on/off/on again IK along the timeline.

If you want to pin a rotation of a hand as well as the position, fix a child of the hand as well, and LW will be constrained to using the fixed rotation.

Surrealist.
05-10-2005, 12:05 AM
Well thank you Dodgy. That was very easy to understand. OK, that rotation is fixed. Never would have figured that out. The rest of the arms still don't create the desired effect I was looking for but this much may solve the placement of the cylinder as those positions remain intact.

Surrealist.
05-10-2005, 03:50 PM
OK I looked at your scene and thinking about it I realized that LW is probably crashing because when I reset the hierarchy all of the original positions are still in place. So the scene will have to be reconstructed from scratch in reverese. I don't have time to completely anylize it. You could do it faster as you know where everything is supposed to be pivot points etc.

But once you do this and as I described making a duplicate of "RMS_base" and calling it "RMS_base_null" or something or even adding a null object at it's pivot point and parenting it to the "RMS base", you should be able to then do as I did with that simpler example and get those things lined up. All you have to do is set the two positions in a linear fashion don't bother setting up any inbetween keyframes to set up a curve.

Then as dodgy described, the object you want to select for this would be the "RMS_base_null". to set the bake area and follow his instructions (You don't have to have the dope track visable just use the IK track - it won't turn blue there'll be a white arrow.)

Then, once you do that you should be set and it will automatically create a natural curve between the positions you set up.

Now that should work. Have fun! Now I am going to run for cover in case it spontaniously conbusts in the attempt. :D

Manowatt
05-12-2005, 09:00 AM
Surrealist - Thanks for taking a look at the scene. You've given me a lot to digest. I've been sick for two days and bedridden, so I'm just getting back to this. I hope to be able to tackle this today.

Dodgy - Thanks for helping us wrap our heads around this. This has proven to be a tougher nut to crack than I ever imagined, but that's how we learn right?

_b

Dodgy
05-12-2005, 10:17 AM
No problem, I've been trying to learn IKB and figure out it's little widgets too :) Finally feel like I'm making some progress.. :)

Manowatt
05-12-2005, 04:01 PM
Okay, here's the latest:

My chain is now reversed, and I've added a fixed null at the end of the chain. When I move the parent of the chain everything moves along as it should, and this would be the end of our story if the last child in the chain would only behave! As you can see from the images below, the last piece of the arm should not move in any way (this piece is fixed in position on the ISS), but it insists on rotating around its pivot. I understand why it's doing this, but how can I make it stop? I tried locking all of it's rotational axes but that did not affect it at all.

This solution is so close, there has to be a way to make this final piece fit.

BTW: I didn't notice any difference with or without the null added to the end of the chain. The chain behaved the same in both setups.

_b

Surrealist.
05-12-2005, 08:20 PM
This is actually great. I think you are there.

Coppied Dodgy's data Below but if you apply this to that last peice - and by the way I think having that null at the end is part of this whole fix so don't disregard it just yet - you will have it.

I had the same problem and fixed it by adding that null and then to the null I applied this below to what he is talkiong about for the "Hand". Only you don't need the dope track just use the IK boost bar at the bottom. Instead of turning blue it will create a white arrow

Dodgy's Data:

IK boost is kind of a blend between traditional IK and FK. It's a lot like IK without Full-time IK on, in that the IK will work while you're manipulating it, but when it's being interpolated between keyframes it'll behave like FK, and may 'wriggle'
You can use what are called bake spots to get around some of this.

Bring up the Dope track when you're using the IKB tool. With your 'hand' selected, right click and drag out the area you want the BakeSpot to be and in the right click menu click 'Set Bake Spot'. The Bake spot is the period during which you want the 'hand' to lock in position.
A cyan area will appear along the dope track.

Go to the IKB Menu in the lower right, and enable 'Auto bind'. Now your locked hand should stay in position in that part of the timeline. When you start moving your parent around again, it may start to wriggle, and you'll notice when you first select it it may show extra keys. This is okay. Just go to IKB Menu>Commands>ReBindMotion All, and it'll fix the motion of the object.

So I think you are there man....I hope :rolleyes:

Surrealist.
05-12-2005, 08:24 PM
Surrealist - Thanks for taking a look at the scene. You've given me a lot to digest. I've been sick for two days and bedridden, so I'm just getting back to this. I hope to be able to tackle this today.

_b

BTW glad you are feeling better - what an ordeal huh?

Manowatt
05-12-2005, 09:55 PM
Alright, I tried that. That corrected the "part-time IK" issue that Dodgy had mentioned, but the point where the arm attaches to the ISS still rotates all around its pivot throughout the 60 frames. It is fixed now, but it still rotates. That point of the arm should look the same in all frames as it does on frame 0. I just can't figure out how to make it stay (not rotate). I tried just taking it out of the chain altogether, and it obviously worked, but then the next link in the chain (now the last child) did the same fixed rotation around it's pivot. It's pivoting on all three axes ignoring the locks that I set in IKB. It should only pivot on one axis. Surely there's something I'm overlooking (hopefully). If I'm not being clear, let me know and I'll post some screen shots tomorrow morning.

I'm so close I can taste it! Oh well, there's always tomorrow. :D

Good night,
_b

Manowatt
05-12-2005, 09:56 PM
BTW glad you are feeling better - what an ordeal huh?

Thanks, I don't know if it was food poisoning or IK poisoning. :D

Surrealist.
05-12-2005, 10:30 PM
What was I thinking? I thought I had tried this out!

My appology! :rolleyes:

Of course if you parent the null to the end object it will to the same thing!

Just load up a duplicate object to the one that is on the end of the chain but don't parent it. Line it up exactly with the end object and make the end oject in the chain invisable. Done!

The goal was to get it to appear to be pivoting from that object. To do that with this method it has to actually be at the end of the chain - unless there is another solution. But since it rotates freely, simply make it invisable and relace it with a stationary object.

I have no idea what I was thinking. Anyway I am 99.9 percent sure this is the ticket.

And if you need to move the space station it will get more tricky(nulls etc) but if not you're in .

Manowatt
05-13-2005, 09:10 AM
Well, the problem with that is that the next object in the chain still rotates as if it's attached to that phantom piece.

I'm a little stumped by the Fix option. When an item is fixed why does it then ignore it's rotational limits/locks? It's as if I need a base on either end of this chain to get the control I need over each end. :confused:

Surrealist.
05-13-2005, 01:49 PM
OK I am certainly messing you up now. I think I have misconstrued even my own set up

BTW the fixed option is only to fix it's location in space - not rotation. This was the only way I could get it to work. With Ik Stop selected the entire chain stoped working. :confused: This combination was the only thing that seemed to work.

Also I thought we were tryin to get the next arm to appear to be rotating...

Lets go with some pics.

Just translate this to your set up.

Below there is a ghosted arm the at the end of the chain. It's pivot point is circled. The next item in the chain rotates from that pivot point which has been fixed to stay in place, However, though the pivot point stays fixed this object roates as if it were one whith the next object like a see saw with a fulcrum in the middle - the circled pivot.

Now of course you don't have an arm at the end of the chain you have a stationary attatchment to the satalite.

This workaround is because I could not find a control to stop the end object from rotating.

Theoretically, if you duplicate the end object(not parented) and just place it there, the pivot will line up. let the ghosted invisible object spinn away. The next arm will appear to be spinning at that pivot.

However, if your pivot points are different in function than this set up, I am a boob and if I am still off the mark post a pic and we'll get it. Or some guru will slap some sense into us and set it right.

OK let's try again, soooo close!

Manowatt
05-13-2005, 03:02 PM
Okay here's an image of what happens when I hide the end effector and clone in a stationary replacement. Now granted, if my pivot was closer to that first elbow piece it would give the illusion of a more accurate movement, but the fact remains that the orientation of the elbow piece would still be affected by this invisible piece.

<bummed>

Surrealist.
05-13-2005, 04:18 PM
Ok I thought so. I thought maybe the pivot point was different. With it off-set like that. OK. And you need to restrict the rotation to one H, B or P. Correct?

OK, give me a momnent... going to look at your set up

..............................

OK yea it looks like fixing overrides the rotation restrictions of that point. So yea if you moved the pivot up.... however the one thing I has assumed was that either it was a free roating joint or the restrictions would be adhered to.

Well there goes my whole solution in a puff! So much for the silver bullet.

Surrealist.
05-13-2005, 05:41 PM
Sorry it has come to this bud but I am stumpped byond belief in that rotational hitch.

I am just comming at this myself I am in the middle of Timothy Albee's character animation and I have gotten to the point where we have set up IK FK and IK Booster for a character. The idea is to set a character for precice movement and placement of the hands etc.

What you are trying to should be a no brainer. A slolution might be a combination of all of these things. Or just simply going back in and keyframing that last pivot using FK or IK once all else is in place. I don't know.

I wish I did.

I do know that for IK you should only be solving for two or three rotaions per chain, so if all else fails you may have to break up that chain between FK and IK and parts for IK booster.

Onother thing might be a pre-bend solution as in character animation where you set up the character in a prebent pose so that the bones are already oreinted in a pose that tells Ik where it is going. This could work for segments too.

Something like this might be worth looking at.

If I have a revelation in my studies, I'll let you know.

Mean time, back to the books.

Manowatt
05-13-2005, 06:43 PM
Well, thanks again for all your help, and thanks for even looking at this in the first place. I'll keep plugging away at it, and I'll let you know if I have any luck. For now I think I need a couple of days away from it.

_b

Surrealist.
05-13-2005, 07:38 PM
Well, thanks again for all your help, and thanks for even looking at this in the first place. I'll keep plugging away at it, and I'll let you know if I have any luck. For now I think I need a couple of days away from it.

_b

Just don't get sick again! :D

Yea, I'm here so please do let me know. If I have a revelation I'll do the same.