Home Website Youtube GitHub

Forward and Reverse FK, ways to achieve it with mGear?

Hi everyone,
I’m building a rig on a creature that can basically be compared to a snake in terms of locomotion and the way to control it.
I’m looking at rig references to implement mine looking for the best and more needed/usefull fonctionnality for our usecase.
I found a video of this Snake rig which has the things I’d like to reproduce. It’s been built in a standard way and I’m of course using mGear.
What I mainly want to achieve is the forward/reverse FK setup he has on his rig, and for which he’s done a video tutorial, while keeping IK behavior as well.
The slider ctls has on top of the snake to set forward or reverse FK is very handy

The thing is that mGear’s approach of dealing with controlers, groups and bones is slightly different.

Does someone has an idea of what would be the best way to achieve this, of course with post scripts.

I saw a post from @dew where he was planing on building a component to do that but there’s no more replies since june 2021

Thanks a lot in advance for the help

I watched the tutorial, and it seems pretty feasible to do with mGear and postscripts. It is basically two fk chains in opposite directions and an SDK to drive the constraint between them, simply sliding and setting that 0.4 value for each control… sorts of that…:sunglasses:

1 Like

Managed to get something, I struggled with the visibility on off when blending goes from 0 to 10…actually… 8-o

You can find the Maya scene, 2024 and the postscript in this link.

Guide is 10 control 01 hierarchy forward and the same backwards, both are keeping the same orientations and positions.
Also, a chain variable IK with 11 IKs and 50 ( or as many as you want) joints. 10+end. Dont keep length.


The postscript is adding an npo to each IK of this chain control, that is, for having the constraint from the forward and reverse controls and still be able to animate the IKs.
After the script runs, you can see the forward controls only;

In the UI host, there’s a blend attribute, 0 to 10, that goes through all the costraints, one by one and changes the values to follow the FK to the Reverse chain. The visibility syncs with it.

The tutorial is using SDK, but it is not really necessary when scripting it.
I went for the attribute blending instead of the control moving along to speed up the process.

Give it a go and let me know what you think or if my approach is not ok.

Cheers.

3 Likes

Hey @Milio,
Thanks a lot for your fast reply, and with a maya and python file as an example !!
Your approach is almost exactly what I wanted.
I did some tests and I had to modify 2 things to do exactly what I was expected.
Indeed, let say I set the FKBlend attribute to 3, it hides forward FKs 0 to 2 and reveals revers FKs from 0 to 2, which is logical.


The thing is that both chains are counter acting if I can say.

So what I did is

  • renaming the reverse FK chain by inverting the order so the parent is FKReverse10_C0_ctl and the last child FKReverse0_C0_ctl.

  • Modifying these lines from
    fwd_index = i
    rev_index = last_index - i
    fwd_threshold = fwd_thresholds[i]
    rev_threshold = rev_thresholds[i]

  • to
    fwd_index = i
    rev_index = i
    fwd_threshold = fwd_thresholds[i]
    rev_threshold = rev_thresholds[last_index - i]


This way, It’s behaving the way I wanted on the FKs.
I now have the possibility to use the reverse FKs for the front of the “snake”, and the forward FK for the remaining part, with the IK ctls following the right FKs

In the meantime, and because I did not know if I would have a reply, and certainly not a working solution so quickly, I did use your worm setup of the Earthwrom Jim rig as an example. It’s a working solution for my creature for now, but will now be able to apply this Forward/Reverse FK setup soon !

Thanks again Milio for you reply, and thanks a lot for all the work and effort in your rigs.
I learned a lot from them !

1 Like

Indeed the ctl translation is a more visual thing that I can easily adapt later !

1 Like

wow! That is so neat!! Glad you found this and the worm rig useful!
With a bit of Python and mGear components combination, pretty much everything is possible!!!
Check the “reset IKs” tool in the Earthworm animpicker. The idea came from Andy Brunton and really helps when animating with the whip or any other IK based rig.
Cheers!

Yes mGear and a bit of scripting makes it so versatile.
I wasn’t too much into scripting but now I love it so much.
I’m now also doing maya tools for our animation pipeline ^^

I haven’t dug in depth into the Earthworm animpicker but will for sure look into the “reset IKs” tool !

Thanks again.
Cheers !

2 Likes

Same here… procrastinated for years learning Python!! now I looked back and can’t believe all the wasted time I spent doing and re-doing stuff manually…all those tasks repeated over and over by hand instead using scripting… haha! Needless to say that Claude is helping me LOADS lately… 8-o

Recorded a video about the worm in an X thread.
https://x.com/MilioSerrano/status/2025147130839449969

1 Like

Thanks for the video.
This feature is indeed very usefull and can avoid loosing so much time when you do things repetitively !

And yes from day to day I’m building myself tools for things I’m doing again and again.
Thinking about creating a real toolbox instead of adding more shelf buttons ^^

I need to try Claude as for now I only used Perplexity or chatGPT which is a bit better.

And I can indeed see in your rig’s postscripts that your approach is slightly different now in terms of scripting. It’s now more based on functions, class/methods rather than doing the same commands over and over.
And it’s way more robust

1 Like

gracias Milio! as always you share with us your experience and rigs. Soooo helpful!

1 Like

haha! Indeed! I started adding Python commands, one after the other. I still think is up to whatever works and solves what’s left to be solved after the rig is built.

Hi Milio,

I noticed the colorful UI that you have for Rig Build in Maya. Is that part of mGear or is that your own toolset? I assume it’s your custom toolset but just thought I’d ask in case I missed something in the mGear menu. Thank you!

Glad you noticed! 8-D That is a tool I have been developing while rigging with mGear. Miquel has been kindly helping me, and now it can be added to the mGear top menu!!!.
I plan to get it released soon, I only need to get a bit of documentation about how to be used…
https://x.com/MilioSerrano/status/2003124917798310328

3 Likes

Amazing! Looking forward to it.

1 Like

i would also be interested in testing the Toolkit Milio!

Looking forward to it

1 Like

wow! I’ll try to release the tool asap then!! :sunglasses:

not long!

3 Likes

Started doing a bit of documentation about the tool. I’d like to capture videos about it.
If you fancy and have time, have a quick look and let me know if it seems ok, understandable, etc. It will be really appreciated!

1 Like

Thank you Milio!
Looking forward to test it and will give you feedback

cannot download it yet over at Gumroad