Home Website Youtube GitHub

Issue with the Post script

Hey I’m using this script

from mgear.maya import rigbits
import os
import pymel.core as pm

class EyeRigger(object):
    def __init__(self):
        # Define paths for eye config files
        self.left_eye_path = r"D:\st_dd_ghatokach\scripts\EyeL.eyes"
        self.right_eye_path = r"D:\st_dd_ghatokach\scripts\EyeR.eyes"
        
    def rig_eyes(self):
        """Main function to rig both eyes"""
        # Rig left eye if config exists
        if os.path.isfile(self.left_eye_path):
            rigbits.eye_rigger.eyesFromfile(self.left_eye_path)
            pm.displayInfo("Successfully rigged left eye")
        else:
            pm.displayWarning(f"Left eye config not found at: {self.left_eye_path}")
        
        # Rig right eye if config exists
        if os.path.isfile(self.right_eye_path):
            rigbits.eye_rigger.eyesFromfile(self.right_eye_path)
            pm.displayInfo("Successfully rigged right eye")
        else:
            pm.displayWarning(f"Right eye config not found at: {self.right_eye_path}")

# Create instance and run the eye rigger
eye_rigger = EyeRigger()
eye_rigger.rig_eyes()

this is a script for automatically set the eyes when building the Rig, but there is some error
image

What version of mGear?

When you’re sharing code, please put it in between triple backticks like this, so it shows up properly as code. I edited your post to add the backticks.

```
Your code here
```
1 Like

Hello !
Did you set up properly your Maya.env file in Documents\maya<version> ?
It looks like your maya doesn’t find mGear module and your file is stored from outside of a known environment for mGear and maya.

Hello,
my rigbits import is:
from mgear import rigbits
can you try that instead of
from mgear.maya import rigbits?

2 Likes