Home Youtube GitHub

Eye/Lips Rig - add secondary layer controls


#1

Hi!
I’m trying to involve mGear in my daily basis, and it’s so cool and powerful.

Still, I’m not sure how to edit and extend current modules, so I’d be glad if you can help me with that.

I have some issues with Rigbits Eyes - Not sure how do you calculate an orientation of the rig, but I got undredicted results sometimes (please see the screen).
Also It is possible somehow to change the controls amount?
It would be great if I could somehow add extra layer of controls that would drive Joints or hiRes Curve.

Best,
Krzysztof

Screen


#2

I mostly used a POST Python script to edit my eye rig.

I can’t figure out what you are trying to show in that screenshot. What’s the problem?

For extending and editing modules, this is what I do. I don’t touch the files in the mGear installation:

  1. In my Maya.env file, I add these lines:
MAYA_MODULE_PATH = P:\OUR\STUDIO\PATH\tools\mgear_2.6.1
MGEAR_SHIFTER_COMPONENT_PATH = P:\OUR\STUDIO\PATH\tools\mgearCustomModules
MGEAR_SHIFTER_CUSTOMSTEP_PATH = P:\OUR\STUDIO\PATH\tools\data\build

MGEAR_SHIFTER_COMPONENT_PATH is the variable you want to add to do custom modules.

  1. Then inside that folder that you specify, you can just copy/paste an entire existing module to use it as a starting template. You can find all the modules here: mgear/scripts/mgear/maya/shifter/component/

  2. Inside your copied module, open up the guide.py file and find the lines that look like this. For example in the control_01 module:

TYPE = "control_01"
NAME = "control"

Change those to something else. For example, I copied control_01 and I made a special module called “hook” that doesn’t have any icons, and doesn’t get added as a “control” in the rig, but can still have all the space switches, etc, for special mechanical purposes in my rig.

TYPE = "hook_01"
NAME = "hook"

If you change those names, the next time you load Maya, if you have this module in your custom module folder from step 1, then this custom module will show up in your list. And you can just freely edit it there, without breaking any existing mGear modules. I’ve found you have to restart Maya to make sure all your modules reload properly. There is a menu item to reload modules, but it didn’t always work for me.

  1. Bonus: Back up your custom module directory in your own git repository.

#3

Thank you! This is for sure usefull and will help me with Shifter! I’ll take a closer look and try to understand it as much as I could.

My question was more about rigbits, but as far as I can see, it’s not as a component - so to edit the rig, I should edit it’s python script right?
Do you have any examples how you approach any changes in the eye rig? I’m intrested how I could add more controls if needed and how to add second layer controls to control each joint.

The screen I attached is the orientation issue, I think it’s based on the extremes of the loop - which could cause some problems if the eye is not “casual”.
Tell me please if I’m wrong.

Based on same solution I wrote a script for eye rigging and it’s taking rotation form selected transform - but I would like to use solution from mgear and try data centric workflow.
Any ideas how I could handle that?


#4

In the eye rigging GUI, there is a checkbox, “Set Manual Vertex Corners”. If you have that checked, it will use the vertices that you specify. If you don’t, then even if you specify vertices, it will still try to auto-calculate which ones to use, and your eye might be at a weird angle.

Is that perhaps what happened? Otherwise, I’m not sure.

I could maybe show some of my code examples later this week. But the kinds of things I changed were:

  • Splitting the blink blendshape curves that get created into upper and lower, so I can have upper and lower blink.
  • Clamping the lower blink by the upper blink, so when you upper blink, it overrides the lower blink and it doesn’t interpenetrate.
  • Remapping the attributes from 0 to 10, instead of 0 to 1.

I’m wondering why you want to add a control per joint. That sounds like it would be tedious to animate. Hopefully you can find ways to fix your issues, so you don’t need that level of control.


#5

It would be awesome if you could share with me your scripts. It’s the best learning source, as I’m still learning Python and my skills are limited just write simple tasks (But I understand a lot, based on my PHP experience).

I’m not sure also what’s happening there, I tried all the options, dug into the code to understand how it’s built and still no idea if I could fix that. Thankfully it’s not asap and I will try to find a solution and learn mGear that way :wink:

  1. Extra control per joints (or better for HiRes curve where the joints are connected)
  • Sometimes I need to add this, for close up shots etc. Not always needed, but it’s nice to know how to add this to the same setup.
  1. Controls amount: This is way more important, as sometimes the default controls are not enough.
    In Neils script, there is a curve for joints (hiRes), and one for controls (lowRes), so If I’m going to have more controls, I’m creating a curve with more CVs as lowRes and then creating controls for each cv.
    Could you give me a hint, how to approach that as pre/postscript?

And going back to the mGear tests, please take a look at this image:

The first part is Neils script, with little modifications I managed to get to this stage, where it seems correct.
But when I’m trying to set corners manually, it’s behaving strangely.

I’m aware that this model is not oriented either in Y or Z axis. Here is the model if needed