IK in Blender

Discussion about everything. New games, 3d math, development tips...

IK in Blender

Postby Electron » Sat Oct 30, 2004 10:31 pm

Does anyone know how to set up IK in blender? I know how to add constraints, I'm just not sure what to set as the target of the IK constraints and I'm also not sure whether I need to use Track To constraints as well.

If I have an armatue consisting of 3 bones -- Root, Middle, and End -- and I want to be able to grab End, move it to a new location, and have Middle and End rotate to follow it so all the bones stay attached, how would I do this?

If I turn off the IK Link To Parent I can grab a bone to move it, and if i add a Track To constraint I can get a bone to continually to face another one, but the bones don't stay together and I can't get the IK constraint to work at all.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
User avatar
Electron
 
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Re: IK in Blender

Postby vermeer » Mon Nov 01, 2004 11:28 am

Electron wrote:Does anyone know how to set up IK in blender? I know how to add constraints, I'm just not sure what to set as the target of the IK constraints and I'm also not sure whether I need to use Track To constraints as well.


From newbie(but weird and 3d freak) to newbie

u only use constrains if u need em.Constrains use to do a rig mor ecomplex to handle. For machinery though, tracking and other constrains are life savers. In general, u go to bones POSE mode, hit ctrl tab when u have an armature selected. select a bone, and then click in the button that is like thre axes, 3 arrows from an origin, tha one before th eedit button, (or F7) , there, u'll see now the constrain tab. Hit add constrain button.


If I have an armatue consisting of 3 bones -- Root, Middle, and End -- and I want to be able to grab End, move it to a new location, and have Middle and End rotate to follow it so all the bones stay attached, how would I do this?


Looks like perhaps u built badly the skeleton. beware. U can create an armature...and automatically ur mouse start building a connected branch...BUT....if u hit escape or right click (depends, some ppl now can setup in prefs to left click to select) so u end the branch, and then hit edit to get outta edit skeelton mode (tab allways toggles edit modes, likle ctrl+tab toggles pose/normal object mode, if armature selected) , and if u with armature selected, hit taba again, u'll start new bone from cursor is. Position cursor as u wish to start new unconected branch. I do so for legs, as I made ik solvers rigs, and want em independent from spine but linked (with simple parenting, if I remember well..I'm now all about XSI)

If u are in a second edit session of the armature, but don't want to continue adding bones from cursor, but from and existing bone, that is, connected, u select the joint from where u want ur bone "grow" and hit e. That's extrude, allways in blender. SO, is extrude bone. That is. U can later scale (s) , or move(g, or dragging left button) that bone. use sevral views for this, as well as for positioning cursor. Good also knowledge of snapping comands , combined with grid, and stuff, to correctly position a curor.Usuallly is enough just to work in ortographic view, non-perspective, and left, front, etc, views (numeric pad 1, 7, 3, ...etc...I think now all ortographic views get ortographic automatically; if ur in perspective, no need any more to hit 5 )

Now the ik solver.

Just works so... To ways :

-Ik Solver needs an object or empty.

create a cube or empty (for example)

select ur armature, hit ctrl tab, and in pose mode slect the bone u want to be the ending bone of the branch with ik, it becomes a brighter blue.

F7, and there, add constrain, Ik Solver. In target, in OB: field, write down the exact (capitols sensitive!!!) name of the object that u want to use as the "handle" that will allow ik moving the branch. That is, for example, Cube, if u made a cube, or Empty if u made an empty (if haves everal, u'll have Empty.001 and stuff, I rename em allways to make the later one writting easier.Engines eat badly the "*.*", also )

bang. Ur done. exit ctrl tab, and grab the cube, it'll ik move that branch...till it finds unconexion. U can go doing armature on separated branches (most usual in blender, and provided u parent em well between them , the x exporter reads and translates well the info) ...OR.... u can go go doing all connected(when a tab on armature, select an existing joint , and hit "e" key), but then your power is disminished.

I do separated branches, but parented. Usually spine is father of bothe legs, or ..dunno now...I think I also do an empty as root and parent all branches to it...well, couldn't tell. In any 3d package, I know things when I'm on it, but curiously never remember each trick when in a fourm. I never read docs as I discover all in the moment, but i recomend u not to do so, specially with Blender. Doc will save u.(blender.org, docu section)

-Ik solver using bones. Just , with selecting armature, hit tab, and spacebar, add bones...u'll add a bone where ever u positioned cursor..u can move the bone independently to rlocate, of course...put it near the final ik bone of the branch...and do as I explained for objects. Just now it's a bone.

I think old advantage was using a bone is it's changes get put in ipo window...good thing as later on u only need to keyframe those frames with keyframes there...I mean, for Jox x exporter to work, ik solvers are not read, so in wherever there's a keyframe of any bone, u need hit a in ctrl tab mode, i , and keyframe rotLocPos...That way u bake ik solvers in standard bone keyframes, Ok? There's a bake animation tool in blender, but dunno well how it works, haven't look at it, but that one seems to shorten this proccess a lot.Just beware as if u use empties or objects, u MUST then see the keyframes in NLA window (different than ipo window, where bones keyframes did appear) and wherever is a keyframe of the cube or empty, u have ik moved there the bones branches, so go to that frame, ctrl tab, "a" key, i key, keyframe RotLocPos.


There are more advanced things: Null bones. I don't use em. I use just empties and unconnected branches, and it all worked, doing as I told, perfectly with Jox exporter. Yep, with ik solver and all complex stuff. DOing finally a full feature, jumping character (you needda leave allways the origin at o,o,o, so...ctrl+tab , hit a, and grab so all bones to new highe position....tht character jumps, but origin stays at 0,0,0. This tirck was told me by Ben. )

Well, some ppl prefer null bones...a nul bones stops ik transmission, I think...I never understood totally well, as having read the doc for most blender stuff, mostly guessed, and null bones is one of those things u'd better read about.

Ok, all this stuff is explained in a quick, practical way...Save this thread, and also look and save the tut from weirdhat, it explains how to do a complex rig with nullbones, even making the toes flex accordingly...but u can leave accidentally the feet unconnected in some points,...needda be careful, and I don't like that animating..reason why I asked for joint real pinning and not this lots of tricks, and why I finally moved to xsi. But a character animation can be done perfectly in blender, andis cheaper ;)

Indeed, My test bad sample animation with ik solver, did not use nullbones, nor the complex Weirdhat tricks, though they'r the best ones, I just wanted to make my life easier, my usual target is the typical indy rt game, not a ocmplex high res dino or alien avi....

I mean, only used to bones for feet, and used to acomodate as needed feet at each needed keyframe...This can end on some sliding though....

DOint weirdhat tricks, u can avoid these problems. Is a matter of likings if u don't mind that workflow.

Weird hat tuts :

(look first hand tut, the foot tut)


BTW, if anyone answer this later, I'll say search the forums... ;)
though I'm passing by forums on inet less and lesss, in general....


If I turn off the IK Link To Parent I can grab a bone to move it, and if i add a Track To constraint I can get a bone to continually to face another one, but the bones don't stay together and I can't get the IK constraint to work at all.


bones needd be connected in same branch. Also, when u add ie and ik solver, often u can't fk move/rotate certain bones in the branch anymore..personallly I only use ik solvers. And don't like the way blender does these character animation stuff. In cs of Max, or XSI, I can do IK and fk at anytime, anybone, and joint pinning is such more easier and solid workflow, specially in XSI.

But as I said, u can do KICKASS animation, in more time and less control -a bit less accuracy in certain cases- in Blender, so, this for free , for ppl with no possibility to buy a package, is simply....GREAT. :)


Hope it helped, as it carried me quite sometime, while I have decided not to post much more...but you've been allways helpful as most irrlicht old users... :)

And hope it serves to others. If u find it works and is good for u as newbie in this things, please, take the job of setup a link to it in the sticky toolls an howtows thread..u or someone...so we can direct new askers there....

I don't mind the grammar. Sure u understood...ur clever :)

OooOps...some links :

Blender animation elysiun forums
http://www.elysiun.com/forum/viewforum.php?f=8

(of course, do "search" first to ask, and dig and search all u want in the other blender sections, or the ones u need)

thread to get started in blender anim :
http://www.elysiun.com/forum/viewtopic.php?t=2556

Immo, all u need for a quick start, as u also needda be coding, etc, and I am not of the opinion of many blenderhead fans that u needda read the whole book or something to get your engine tests done...

just read what I told u , and if needed extra info just these two tuts...

http://blenderchar.weirdhat.com/handtute/

(btw, u don't need to do all so, "unconnected", there are dozens ways of doing a rig, be creative on doing the one that fits u, invent it. )

and then, more advanced (beware, is not a whole thing, is 3 ways of doing the irg, and the third is th emore complex, but more accurate ) :

http://blenderchar.weirdhat.com/foottute/


Well...as allways, in the way, u may need to just read about some tiny technical detail...instead of reading all that info, dig in the online doc INDEX about that aspect, the section that may speake to it. Tip: it oftens does not gets as deep as needed :They do a great effort, for free, but blender is allways growing crazily, things get outdated, and also, in every package, the real use teaches loads of important workaorunds not in any manual, which are the real pro ways to solve problems. that u'll easily find using good searchs in Elysium, it's been asnwered all , and continues with every new feature added. Do so in case u need, as I am one of those to reduce the effort to minimal to not make this boring.


OK?

Say if it helped, I may not pass over here, but if I do , I like to see if helped all my big effort in a post like this. I write very quickly, but even so....

Today I have dead time, but is not gonna be so much more more times. maybe never :)

That's why I strongly agree with anyone that may think that if this post is found useful and not leading newbs to a bad concept, or at least,while not being too "classic" aproach (that perhaps would be more effective with newbies) it served u to get stuff done , and later on seen in the irrlicht engine...please...SAY SO :) Is always quite a good thing to check it served for something, and not loose time and a lot of ascii character into the empty virtual space,... ;)

I mean, if so , then please someone paste the link to this with something like animating characters in blender for irrlicht and the link in the sticky at faqs howtos and tools thread. I don't remember how to do this, and what rules applied or who can post there. I'm not an admin, and can't remember now.Also would be crucial, and needed to th whole thing work to link just bellow that other thread of Jox about how to use his x exporter 1.2. Which if done well, leads a perfectly mview x compliant complex character animation. Proved totally by this crazy guy I am ;)

BTW, I see u've been very respectful posting in off topic. But I think, the effort would require much more attention to it....anyway, if pasted in the sticky in that tools forum, it'll be not a problem for people stuck to find it.
Finally making games again!
http://www.konekogames.com
User avatar
vermeer
 
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm

Postby Electron » Mon Nov 01, 2004 9:07 pm

Thank you very much for taking the time to explain the ik stuff in simple terms, and thanks for the links. I have seen the WeirdHat tuts, but the null bones stuff put me off. In just a couple minutes after reading your post I was able to get Ik working with an Empty as the target of the constraint, I'm about to try with another bone as the target

edit: added link on general FAQ thread to here
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
User avatar
Electron
 
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Postby vermeer » Mon Nov 01, 2004 10:17 pm

hey! So, indeed it served u to understand it ! great.I was a bit unsure. But I know most game coders and people just wanting to put their models in game need a less complex, quicker explanation than usual manuals.

I could do this with many other things in Blender, and many other softwares if I had the time, which I haven't. But is very useful your feedback. As seems it was as I expected, that way of explanation, quick and dirty, direct to the things, seems to work. Good to know in case my laboral and time stuff improves many months later on, and then I guess if I feel in the mood for a tuts site, this would be the style of telling things. Of course, better grammar ;)

And thanks too for putting the link. Every time this is done with a useful tut, is loads of less people lost (and asking this questions ;) )

:)
Finally making games again!
http://www.konekogames.com
User avatar
vermeer
 
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm


Return to Off-topic

Who is online

Users browsing this forum: No registered users and 0 guests