Home Website Youtube GitHub

Custom scripts facial rigger

hello. until now I’ve always used the legacy lips and eye rigger, but lately in the newer versions of mGear it started giving me some weird problems so I thought it might a time for me to move on from my comfort zone and switch to the new facial rigger.
so far, I’ve always added my lips and eyes with those scripts:

()mgear.rigbits.lips_rigger.lipsRig
()mgear.rigbits.eye_rigger.eyeRig

I found out that now there is mgear.rigbits.facial_rigger.lips_rigger and also one for eye and brow rigger but I could only find the option of “from file”. I rather not do it from file, but do it with the same functionality of the lipsRig and eyeRig modules as can be seen in the picture I’m attaching.
is that possible?
thanks in advance

btw, another question: is there a documentation page somewhere? because the only one I found was a really old one that didn’t even have the facial_rigger in it

Hi @Eliran_Magen

In the new versions for the lips and eyes, the new function to call is rig()

Lips:
old:

def lipsRig(eLoop,
            upVertex,
            lowVertex,
            namePrefix,
            thickness,
            doSkin,
            rigidLoops,
            falloffLoops,
            headJnt=None,
            jawJnt=None,
            parent=None,
            ctlName="ctl"):

new:

def rig(edge_loop="",
        up_vertex="",
        low_vertex="",
        name_prefix="",
        thickness=0.3,
        do_skin=True,
        rigid_loops=5,
        falloff_loops=8,
        head_joint=None,
        jaw_joint=None,
        parent_node=None,
        control_name="ctl",
        upper_lip_ctl=None,
        lower_lip_ctl=None):

Eyes:
old:

def eyeRig(eyeMesh,
           edgeLoop,
           blinkH,
           namePrefix,
           offset,
           rigidLoops,
           falloffLoops,
           headJnt,
           doSkin,
           parent=None,
           ctlName="ctl",
           sideRange=False,
           customCorner=False,
           intCorner=None,
           extCorner=None,
           ctlGrp=None,
           defGrp=None):

new:

def rig(eyeMesh=None,
        edgeLoop="",
        blinkH=20,
        namePrefix="eye",
        offset=0.05,
        rigidLoops=2,
        falloffLoops=4,
        headJnt=None,
        doSkin=True,
        parent_node=None,
        ctlName="ctl",
        sideRange=False,
        customCorner=False,
        intCorner=None,
        extCorner=None,
        ctlSet=None,
        defSet=None,
        upperVTrack=0.02,
        upperHTrack=0.01,
        lowerVTrack=0.02,
        lowerHTrack=0.01,
        aim_controller="",
        deformers_group=""):
4 Likes

thanks Chris! exactly what I was looking for! :slight_smile:

Hi there !
So if I want to build the eye from file, in the facial rigger, I have to run :

from mgear.rigbits.facial_rigger import eye_rigger
eye_rigger.rig_from_file(path='my\path\is\here.py')

And same for eyebrows and lips ?
Any help could be appreciate :slight_smile:

Yep it’s the same for all three:

import mgear.rigbits.facial_rigger
mgear.rigbits.facial_rigger.eye_rigger.rig_from_file(eyesConfigPath)
mgear.rigbits.facial_rigger.lips_rigger.rig_from_file(lipsConfigPath)
mgear.rigbits.facial_rigger.brow_rigger.rig_from_file(browConfigPath)

Other details:

“path” isn’t a kwarg, so you can use either rig_from_file(path='your/path') or just rig_from_file('your/path')

Also if you are using backslashes, make sure to use r'your\path\here or 'your\\path\\here' or your/path/here or use the os.path module.

2 Likes

Ok nice ! I just succeded to build it from script before to see your answer :slight_smile:
But I don’t really understand how os.path.module works :confused:
Because I thought to check the export_Skins.py by Miquel, and I did’t succeeded to use it well