Home Website Youtube GitHub

Modifying ctl curves and rebuilding rig

Hi mgear team,

very grateful to be able to use my favourite xsi rigging plugin in maya, feels like a home from home!

Something I’m struggling with is having made alterations to the ctl curves to fit the character, if I need to rebuild the rig is there a way to copy over all the changes? Like how you can save and import skinning using skinpacks?

Thanks for all your hard work,
Matt

Hi @mattmos

To store the control shapes use Extract controls command:

Not sure if I understand the question.

the commands to import export are in the menus:
image

If you need/want to use custom steps check the youtube channel Data centric workshop. I am talking about it in one of the videos :wink:

Cheers,
Miquel

Thanks for the quick reply! The extract ctrl button didn’t work the first time I tried it, but since then is now working just fine, and the skinning is working great :slight_smile:

Is there an option anywhere to add an extra jnt to the joint chains that are created? In effect I’d like there to be an extra ‘bone’ so that the initial skinning distribution would work better, for example the geodesic voxel skinning seems to calculate from the length between joints, so the final single joint doesn’t skin the end of the mesh correctly.

Cheers,
Matt

Hi @mattmos

There is no option for that. I know about the initial skinning. But to be honest I never use the initial skinning, always re-do it

TIP: ngSkintools assign weights does it correctly without the last joint
image

Cool, geodesic and brsmoothweights has got me 99% there recently in no time at all, but I have been meaning to take a look at ngskintools, so this is a good reason to try it out. Thanks for the reply!

1 Like

@mattmos did you find how to load skinning through Python on Youtube? If not, here is how:

You can load skinning using the mgear.core.skin.importSkinPack(yourPath)

Here is my example of a POST script that loads the skinning. If the skinning doesn’t exist yet, it just skips it. I put all of our character’s skinning under a directory with their own name, so the script can find a path based on what the character was named.

My example path for the skinning is Y:\[Our Studio Path]\Rigging\rigging\data\characters\tom\skinning\skin.gSkinPack

import os
import pymel.core as pm
import mgear.shifter.custom_step as cstp
from mgear.core import skin


class CustomShifterStep(cstp.customShifterMainStep):
    def __init__(self):
        self.name = "import_skinning"
        # This is set from "Rig Name" in the guide settings:
        self.charName = pm.PyNode('guide').rig_name.get()


    def run(self, stepDict):
        char = self.charName
        postpath = os.path.abspath(os.path.dirname(__file__))
        # Move UP in directories until we get to the base path of the rigging data
        basepath = os.path.abspath(os.path.join(postpath, '../../../..'))
        skinpath = os.path.abspath(os.path.join(basepath, 'data', 'characters', char, 'skinning', 'skin.gSkinPack'))
        
        if os.path.isfile(skinpath):
            skin.importSkinPack(skinpath)
        else:
            return False
        
        return

1 Like

@chrislesage

Thanks for the heads up here! We should put all your replies in the official documentation (seriously)

Thanks @chrislesage , that is awesome! Much appreciated :slight_smile:

Sure, feel free. Grab, use and edit anything I’ve written here.

I sure will when building the newer documentation

@mattmos

Here is a little Python snippet to create “tip” joints. Select the end joints you want to add joints to, and run this.

Then your default weights will be a little bit closer to correct. I set them quite far away, to make sure they don’t get any influence. Then I just delete them before exporting weights.

image

I do like Miquel says and use ngSkin to redo all my weights. But it is pretty necessary to add tip joints if you want to use the “Heat” method of weighting, which is pretty good for generating first-pass hand weights. Otherwise you get noodly garbage weights at the finger-tips. <Shakes a cold fist at Autodesk!>

(I use heat weights on a duplicate geo, and then copy that as an ngSkin layer to my real geo, to skin my hands. Everything else I usually use ngSkin directly.)

import pymel.core as pm
tips = pm.selected()
distance = 8.0
for each in tips:
    oDup = pm.duplicate(each, n=each.name().replace(each.namespace(), '') + '_TIP')[0]
    pm.parent(oDup, each)
    oDup.setTranslation(each.getTranslation(space='object')*distance, space='object')
    oDup.radius.set(each.radius.get() * 2.0)
1 Like

Thanks for the tip @chrislesage

Thanks Chris, really appreciate the help. Great idea to add extra joints then delete after skinning.

Hey All ! Is there a command to use in python in order to extract the control in a pre_script ? Can’t find anything about that in the forum, maybe I missed something ?
Thanks

Hi Gustave,

Yes there is. I don’t think it’s in the documentation. But you can always find the commands that are being run from the mGear menu by searching in:

mgear_X.X.X/release/scripts/mgear/shifter/menu.py

And in there, you find this command. It only runs on selected objects. There is currently no way to pass that function a set of objects. So make sure you select the controls before running the command.

from mgear.shifter import guide_manager
guide_manager.extract_controls()

The function is found under here. So it could be modified to accept a set of objects:
mGear/tools/mgear_X.X.X/release/scripts/mgear/shifter/guide_manager.py

2 Likes

Oh nice thanks a lot Chris !

1 Like