Home Website Youtube GitHub

Custom step post script error

Hi! I am a bit struggling with the post scripts, especially with importing the gimmick joints when re-building my guide.
You can see the error message below. I started by writing the same script as we see in the Youtube videos, had a similar error, and then figured my files organization might slightly differ from what Miquel has on his computer. But now I’m having trouble fixing my script!
Also, I might have two different locations in my PC for mGear 3.7.11, one in my (C:) and the other one in my (D:). I’m sure this is a very bad files management… could it be the source of the problem?
Thank you in advance. :slight_smile:
Screenshot 2021-09-16 172446

Hi @gabrielledaid this is a simple fix. You might want to clean up your file structure, but it isn’t the problem in this case.

In your script you have:

from scripts.mgear import rigbits

The error on line 3 says scripts.mgear does not exist.

You want:

from mgear import rigbits

1 Like

Good morning @chrislesage !
I wrote that because the usual wouldn’t work either. The issue appears with my importSkinPack now. Here are a few screenshots which I hope will help! Sorry for this mess :sob:

Screenshot 2021-09-19 114527

Screenshot 2021-09-19 115544

First, don’t feel bad about the mess. It’s tricky to learn. (And small syntax errors are very easy to make, even with years of experience.) :slight_smile:

The problem is on line 2 where the ImportError is telling you to look. It’s the same problem as before. You’ve typed a module name that doesn’t exist.

from mgear.maya import skin ← this is incorrect.

from mgear.core import skin

I don’t know what your experience level is with Python, but if you are new to scripting, I highly recommend taking a few beginner Python tutorials which will teach you how to read a stack trace error. It will help you enormously! Then you’ll learn exactly where to look for problems. There was no need to dig inside your environment variables. Basically speaking, the Traceback shows you the most general information at the top, to the most specific at the bottom.

So the last 3 lines in your error tell you:

  1. Which script is failing, including which line number
  2. What the failing line looks like.
  3. What error the line caused. An ImportError.

MayaTraceback

3 Likes

Ahhh that was it! I thought I tried that one before, but I understand coding takes a lot of practice. Thank you also for the recap, now I’m sure how to read the ImportError message. Have a wonderful day!