WIP - "FKIK manipulate bones" tool.

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Re: WIP - "FKIK manipulate bones" tool.

Post by funksmaname »

if i remember correctly, the tool doesn't do anything you can't do with the normal tools per-se but solves gimble lock differently to avoid broken joings... i think if you animate mostly with the normal bone tools and just click a bone with the FKIK tool if it is interpolating strangely or breaking joints that should fix those instances.
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Thanks funksmaname.

That's too bad, doesn't that mean it's actually only (new and better) IK. And not FK at all?

I was hoping the tool would allow me to manipulate the bones in an FK kind of way (moving the upper leg and dragging the feet up).
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by capricorn33 »

Hey,

I haven't revisited this tool and thread for a while now, sorry for my abscence. It's been a year since I last spent time on it, but maybe NOW might be a good time to continue working on this one...
Meanwhile, I noticed that I actually haven't uploaded my latest version of the tool, here it is

https://dl.dropbox.com/u/19247240/FKIK% ... _bones.lua

(It's also mirrored in the top post of this thread.)
The embedded script is unchanged.




Lukas, about IK and FK.

Sorry to say you are right, there is no working FK implemented yet. It has been the plan all along to make it a 100% working FK / IK hybrid, but I got stuck with the vectormaths last time I was trying to fix it. I do have a version of the script with FK added but it's still unstable. I'll release that one when it's working properly.
I know it's a little confusing that the name of the tool has "FK" in it.... I named it "FKIK" exactly for this reason; it IS going to be a FK / IK hybrid - when it's finished. :-)

In this, the latest version of the FKIK-tool, you will find a kind of "pseudo"-FK... i.e. you can actually move the foot or legs or whatever around using the FKIK tool, but it's actually not FK, it's just a projected version of IK. You will understand what I mean when you try it out.
So... it still isn't FK but it makes working with the rig a lot easier, until I get proper FK in place.



And some further notes on what the FKIK-tool actually DOES or DOESN'T do.
....thanks, funksmaname, but you got it a little wrong... :-)

- the tool carries the same code as the embedded script does, meaning that the tool can handle all the .aim and .trg-bones and the IK-function even WITHOUT the embedded script activated. BUT the connection between .trg and .aim-bone will only interpolate correctly ON KEYFRAME, not in between keyframes. You need the embedded script for that.
This means that you could for instance block out poses even without the embedded script, using only the tool, if you want to.

- the tool is also built to make a certain kind of workflow a little easier. As long as you only rotate rig bones or move IK bones or the whole rig around you don't have to change any tools to do these different actions. You can do all these things from inside the FKIK-tool.



This is how it works:

- by default the FKIK tool works in the same way as the "manipulate bones"-tool
on all frames above 0.

- hold alt-key to force FK rotation (normal bone rotate) instead of IK action (manipulate bones).
This is true for all limbs or chains of bones where there aren't any .trg or .aim-bones involved.

So it's mainly normal "manipulate bone"-functions, except for;

- All .trg-bones are TRANSLATED when you drag them. Hold alt-key and they ROTATE instead.
This is then obviously the "IK-function" on feet, for instance.

- The TOPBONE (bone without parent) in the rig is by default TRANSLATED. Hold alt-key and it will ROTATE instead.
This means that if you select the topbone + all .trg-bones simoultanously you can translate the whole rig around.
(Hm... I just noticed that you actually have to use the "translate bone" to move several bones at the same time...
I will have to correct that one so that it can be done from within the FKIK-tool as well.)


I always build my rigs with a separate TOPBONE (or masterbone, or whatever you like to call it). In a normal biped rig it
would be the parent of the hipbone. This bone itself is unparented.
Using the FKIK tool it automatically goes into "translate"-mode, while keeping the hipbone by default in "rotate"-mode.
Which is very handy, in my humble opinion.


All that's really missing here is that darned FK. But I'm on it! :-)
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Thanks Capricorn, this new tool is awesome! Good work.

It's still not true FK, but it feels a little bit like it already. I'll keep an eye on this thread! Can't wait to see how this develops.
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by capricorn33 »

well... what the heck... I might as well share this one, even if it's not 100 % functional yet.
At least I think Lukas will be happy to see it. :-)

https://dl.dropbox.com/u/19247240/FKIK% ... _v4_hl.lua


With this new version of the embedded script you'll see that you are able to use the 'rotate bone tool' for real FK action.

It's not fully functional yet, though.
As you'll notice the .trg-bone at the end of the IK chain won't rotate with the FK action, it only translates along with the movement... but as i said earlier, I'm already on it. :)
And if I remember correctly (it's been a year since I looked at it) there was also some problems with nested .trg bones that I have to sort out before I can make the corresponding updates to the FKIK tool as well. THEN this thing will be finished.

But just as a proof of concept... real FK is coming up.

cheers
cap
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Great update, you're fast. It feels stable enough to use it in our next project. I'll let you know any issues. But it looks like you know what you are doing. :)

Edit: And it would be nice if the manipulate bone tool would work FK too, like the rotate bone tool now does. (right?)
Edit: Uhhh. I guess not, you need to be able to rotate bones IK too.
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by capricorn33 »

Well, I don't know how "fast" I am. This updated script has been in my drawer for a while...


Hm... If you plan to use the updated embedded script for production use you will also want to use this replacement 'bone scale'-tool instead of the default one:

https://dl.dropbox.com/u/19247240/FKIK% ... e_bone.lua
For installation; simply replace the old lm_scale_bone.lua file with this one.

There's a small mod inside that makes the embedded script work with scaled bones.
Without it you will have problems (the .trg and .aim-bone won't connect correctly if any bones in IK chain are scaled)...

Oh, and maybe I also should point out that these files still aren't fully adjusted for AS9... meaning that the "multi keyframe editing thingy" isn't implemented yet.


Thanks anyway for the appreciation, and please do give me feedback on how it works out for you.
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Scale tool works fine, thanks :)

A workflow issue I'm having:
When I drag my hips with the translate bone tool. It would be good to also be able to translate the feet too (for example, while jumping in mid air). Let's call it FK-hip translation ;)
User avatar
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Re: WIP - "FKIK manipulate bones" tool.

Post by funksmaname »

Thanks for the clarification, it's exciting this is coming back to life!

Lukas, from what I understood, if you have a master bone, and the hips are parented to it (as is the torso) then moving that bone will translate e whole rig, including the feet... Can't try it right now, I'm sitting on the loo. :D

Thanks Cap!
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Hm, that doesn't seem to work for me Funk. Should it?

What I'm doing now is, when I drag translate the 'hip' I also select the bones of the foot (or feet) I want to move along with it.

A small annoyance I've countered was: When you animate 'FK', it sets a translate key on the foot. I understand why this is necessary, but the problem is, you'll gonna need more translate keyframes on the feet, because only keyframes on the legs aren't enough, because the movement of the feet will always be calculated by its translate keyframes. With normal FK you wouldn't need those extra keyframes because it knows the foot is attached to the leg bone.
Uh...I hope that made any sense. :)
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by capricorn33 »

Lukas wrote:Hm, that doesn't seem to work for me Funk. Should it?
No. What I meant is that this is my plan for how it should (and will) work. The possibility to multiselect masterbone and trg.bones from within the FKIK-tool, I mean. But right now it doesn't work.

(Oh, BTW, an even simpler way to achieve "master bone" function is to simply use normal parenting... parent the rig topbone AND all trg.bones to the same "rig masterbone" and then the whole rig will translate along as you translate that masterbone. But make sure you keep this rig-masterbone separate from the hipbone... you WANT to be able to move the hip around while not affecting the feet, for instance.)
Lukas wrote: A small annoyance I've countered was: When you animate 'FK', it sets a translate key on the foot. I understand why this is necessary, but the problem is, you'll gonna need more translate keyframes on the feet, because only keyframes on the legs aren't enough, because the movement of the feet will always be calculated by its translate keyframes. With normal FK you wouldn't need those extra keyframes because it knows the foot is attached to the leg bone.
Uh...I hope that made any sense. :)
Well spotted, Lukas! That's a major flaw in the whole idea.

Of course the FK should be driven from the rotation of the aimbone (leg, for instance) and not by translation of the trgbone (foot). But the way I built it that is exactly what it is doing.
So I have to rethink this. Well spotted, Lukas. Thanks!

- - - - thinking ... - - - - thinking ... - - - - thinking ... - - - - thinking ...


This is my altered development plan then;

- FK should be rotation driven from the aimbone part of the chain, and IK should be driven by translation keys of trg.bone

- this means that the INTENT of the user must be saved to the file, everytime a bone tool is used and a bone is touched

for example;
When the user selects to work with the rotate bone tool on a bone in the aimbone-chain the bonetool should record userdata info as "intent to do FK action on this particular keyframe and this particular selected bone.
And if the user chooses to use the translate bone tool on a trg.-bone the translate bone tool should record userdata saying that this time the user intended to do IK action on this particular keyframe and bone.

Then the embedded script can fetch this data later, for each keyframe and bone, and interpolate correctly and place the trg.bone group as intended in the tweening sections of the movement.

- This also means that all bone tools should be dedicated for this FKIK use. More precisely; you would have to use slightly modded versions of the LM rotate, translate and scale bone tools (or the specially designed FKIK-tool of course), which can write the necessary userdata to the file.

But if this works they way I think it might, this would result in a pretty seamless, hybrid FK/IK experience. All depending on which tool you choose and which bone you select to drag on.



This should all be doable.
I'll see if I can make it work. :-)
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

capricorn33 wrote:This should all be doable.
I'll see if I can make it work. :-)
It sounds mighty complicated. But it's good to know you've got a plan. I'll be using the current script, even with the flaws it has, it's much better than the original lock bone function.
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by Lukas »

Hey Capricorn,

I'm working on a project, and I have multiple characters who all have your great script embedded.

The problem is, if I animate character 1, it also puts keyframes on character 2.

I hope it's possible to fix this, otherwise I'd have to remove your scripts from all the characters which would be a shame.
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Re: WIP - "FKIK manipulate bones" tool.

Post by capricorn33 »

I sent you an email, Lukas.
capricorn ( - just call me "cap")
children's tv pro, character animator
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: WIP - "FKIK manipulate bones" tool.

Post by chucky »

I'd love to see a video of this at work.
If anyone has the time that is.
Camstudio is a free screen cap app I have found great for this kind of thing.

How's that 'other' script going cap?
I feel sorry for the people who don't have it.... so awesome. :wink:
Post Reply