Home Website Youtube GitHub

Sharing 4 Custom Shifter Components

Hey everyone,

I’m sharing 4 custom Shifter components I made. I did not write these from scratch. I just copied existing components and edited them to suit our needs a bit. I also can’t guarantee they will work for you and your rigs. I can’t remember all the ways I still change things with POST custom Python scripts.

  1. finger_aim_chain
    Based on the chain_01 component. I made this for our fingers, but it could be used in other areas. I made it so that each segment aims at its child, so that you can translate without skewing. This gives you nice ability to “sculpt” the pose of the finger, almost like it was IK. But the controls are still FK rotation as well.
    finger_chain_module

  2. hook_01
    I use this often! This is identical to control_01, except it does not create a control icon. And instead of “_ctl”, it is named “_hook”. It also doesn’t add itself to the controllers selection set. This is meant for when you want to have an empty group, but still be able to add things like space switching, for hidden rig functionality. It can also be used to organize your rig.

  3. spine_horizontal_01
    This is based on spine_ik_01, but the orientation of the controls has been changed, so that when the spine is rotated 90 degrees forward for a quadruped, Y is pointed UP on all the controls.

  4. foot_bk_02
    I made a slight change to foot_bk_01, so that the IK rolls are world-oriented, instead of getting their orientation from the locator placements. If your feet are not perfectly flat on the ground, the IK controls would have a tilt to them. We preferred them to be flat to the world on our rigs that had curved toes.

17 Likes

This is great @chrislesage Thanks for sharing it! :smiley:

I will check it ASAP :smiley:

1 Like

Thanks Chris. Especially for spine_horizontal_o1 module.

1 Like

Really cool!! Thanks for sharing! I really like the finger component!

1 Like

Looking good! Fingers working awesome! Although, I have a problem with the simplest one :wink:
It seems to be working exactly as Control_01

Oh whoops!

You’re right! It looks like I never finished hook_01! But I completely forgot because I process any control named *_hook or *_null in my POST scripts! I wrote this so long ago I forgot about it.

(This code is extracted out of a larger POST script, so it hasn’t been tested.)

import pymel.core as pm
import mgear.shifter.custom_step as cstp

class CustomShifterStep(cstp.customShifterMainStep):
    def __init__(self):
        self.name = "fix_selection_sets"

    def run(self, stepDict):
        oModel = stepDict['mgearRun'].model
        self.charName = oModel.rig_name.get()
        self.remove_hooks_from_sets()


    def remove_hooks_from_sets(self):
        ''' I use a custom module hook_01 which should not be registered as a controller'''
        charName = self.charName
        
        setsToFix = []
        if pm.objExists('{}_controllers_grp'.format(charName)):
            setsToFix.append(pm.PyNode('{}_controllers_grp'.format(charName)))
        if pm.objExists('{}_face_grp'.format(charName)):
            setsToFix.append(pm.PyNode('{}_face_grp'.format(charName)))
        if pm.objExists('{}_clothing_grp'.format(charName)):
            setsToFix.append(pm.PyNode('{}_clothing_grp'.format(charName)))
        
        for eachSet in setsToFix:
            hooks = [
                each for each in eachSet.members(flatten=True)
                if each.name().endswith('hook')
                or each.name().lower().endswith('dummy')
                or each.name().lower().endswith('_null')
                ]
            # removeMembers command relies on a non-empty list or it fails...
            if hooks:
                try:
                    eachSet.removeMembers(hooks)
                except:
                    continue

        # Now remove the controller tag and shapes from all hooks as well.
        hooks = [each for each in pm.ls('*hook', type='transform')]
        for hook in hooks:
            pm.delete(hook.outputs(type='controller'))
            pm.delete(hook.getShapes())

1 Like

Is there a trick to adding this to my environment and getting them to show up in the Guide Manager?:

MGEAR_SHIFTER_CUSTOMSTEP_PATH = /production/mgear/custom/

Can it be under /mgear like?:
/Users/my.name/Tools/Art/mgear/shifter_custom_clesage/

That’s for the Pre and Post Python scripts. You want:

MGEAR_SHIFTER_COMPONENT_PATH = /Users/my.name/Tools/Art/mgear/shifter_custom_clesage/

1 Like

Thank you. Look forward to trying these out for quadrupeds

You have it listed as CUSTOMSTEP in the README.md

What README.md is that typo in? I’m not sure where to look.

1 Like

@Count_zer0 maybe this helps
https://www.mgear-framework.com/mgear_dist/official-unofficial-workflow.html

1 Like

Blockquote To install and use these:

  1. Download or clone the repository.
  2. Put the files somewhere on your computer. Example: /production/mgear/custom/
  3. In your Maya.env file, add the following line. Point it to your own directory.

MGEAR_SHIFTER_CUSTOMSTEP_PATH = /production/mgear/custom/

1 Like

Thanks, fixed. I was looking in the mGear places, not my own repos. ha!

1 Like