Home Website Youtube GitHub

Parenting controls (belly like) in mid spine components

Hi there! I have been using mGear for a little while, still learning and figuring out how to use it, although so far I’m very impressed by how easy, efficient and powerful is.
However, i have been stuck for some days trying to figure out how to parent some more controls under a spine. For example I have a character with a big belly that I would like to parent in between the lower hip and the chest. Is it possible? How can I do such a thing?
Thank you in advance and keep up with this awesome tool…Cheers!

Hi @Emilio_Serrano

The joint connection can be done from the UI.

But the rest of elements need to be connected with a post Custom step (a script) that reparent the 2 elements the way you want.

I see!! I’d expect once the join is parented using this UI clever way…the control rig would be automatically set too. 8-D
I’ll try the post steps for doing this and much more needed after the building pass.
Gracias!

@Miquel The video seems to go over how to index the joint structure, but not how to connect components inbetween the start and end of the spine?

I am using a custom step to re-parent the rest. Usually the transform or control that drives the joint. But, never to the joint itself.

I want to add better parenting in the future, but since is very easy to do with custom steps is low in my priority list :stuck_out_tongue:

What is recommended to reparent? The root of the component?

Is there a problem with parenting to the joint?

yes the usually the root of the component

is to keep clean/separated the joint structure and the behavior structure. But there is nothing stopping you to mix it if you wish :wink:

1 Like

Hello !
Old thread here but stills relevant because the behavior is still the same. So I wrote a draft post-script to solve the controler that doesn’t follows the hierarchy where the joint is parented.

from maya import cmds

# get all the guide that has a parent joint index different than -1
rootList = cmds.ls("*_root", type="transform", l=True)
guideList = []
for root in rootList:
    if cmds.attributeQuery("isGearGuide", node=root, exists=True):
        if cmds.getAttr(f"{root}.parentJointIndex") != -1:
            guideList.append(root)

# for each, get the root of the controler
for guide in guideList:
    # get the root of the controler
    grpList = cmds.ls(guide.split("|")[-1], l=True)
    grpList.remove(guide)
    ctrlRoot = grpList[0]
    
    # get the bone constrained by the controler
    ctrl = cmds.ls(cmds.listConnections(f"{ctrlRoot}.message", source=False, destination=True), type="transform")[0]
    matrix = cmds.ls(cmds.listConnections(ctrl, source=False, destination=True), type="mgear_matrixConstraint")[0]
    bone = cmds.ls(cmds.listConnections(matrix, source=False, destination=True), type="joint")[0]
    
    # apply a parent and scale constraint from the parent of the bone to the root of the controler
    parentBone = cmds.listRelatives(bone, parent=True, type="transform")
    cmds.parentConstraint(parentBone, ctrlRoot, maintainOffset=True)
    cmds.scaleConstraint(parentBone, ctrlRoot, maintainOffset=True)

I hope it will fit your needs !
Tell me if you see anything wrong here or if it could be improved.
I hope one day we’ll have a setting like “parent control index” like “parent joint index”, or a checkbox like “follow hierarchy of parent control index” or something like that… :grin:

EDIT : it works for control_01, not for layered controls

2 Likes