Home Website Youtube GitHub

Mgear componenet collapse at origin

Hi,
I am using mgear 4.0.9. It is working fine when I use it as a normal Maya file. However, I am also using Prism for my project https://prism-pipeline.com/. When I open Maya files through Prism and try to build something through guides, everything is collapsed in origin.

I am getting the following error message:
// Warning: line 1245: The default image may not be modified. Use the -i/image flag instead. //

File read in 0.34 seconds.

Warning: Custom component name: pycache, already in default components. Names should be unique. This component is not loaded

The error doesn’t seem relevant. Did you paste the entire error?

It looks like mGear isn’t loading properly. So maybe Prism is overriding which modules or plugins load.

If you type import mgear in your script editor, does it give an error?

When I open the file through Prism and open Guide Manager, I get the following error:

Warning: Custom component name: pycache, already in default components. Names should be unique. This component is not loaded

Nothing else.

imoprt mgear doesn’t show me any error.

I am mainly working with 2022 but I also tested it in 2021. It seesm that Prism is giving some problem.

Oh I see, then the error might not be irrelevant.

  1. If you go to your plugin manager do you see the mgear_solvers plugin loaded? I’m guessing no.

  2. Also, Prism (which I’ve never used and have no idea about) might be overriding your Maya.env file. Do you define MGEAR_SHIFTER_COMPONENT_PATH in your Maya.env file? If that is getting overwritten, that might cause the Custom component name error. You might have to make sure that path gets defined in Prism if it is taking control of the environment.

Because I assume you are attempting to load a rig that uses one of your custom components. But if that path is not defined, then the custom component is not found.

  1. How did you install mGear?

Hi.
Thanks for the quick reply.

  1. It is loaded
  2. No, I haven’t defined it yet. I am using default settings.
  3. By dragging and dropping the file

Hi @chrislesage , have you found the solution for this? Should I install mgear in different manner?

Hey @Utkarsh_Agnihotri,
I am using Prism with Maya 2022 too, but not on mGear4 yet. I think that’s pretty much like Chris said about the Environment Variables before.

When loading Maya (or other DCC) from Prism’s Project Browser, it adds your current Project path in the environment variables.
So it may be wiping your default environment (which is odd, usually it doesn’t mess with settings of things you already have installed).

Try this: copy the mGear folder from your user’s Maya script path (normally found at \Users\your-username\Documents\maya\scripts
) and paste it inside your active Prism’s Project Custom Modules (if using default settings, it should be something like “00_Pipeline
CustomModules\Maya\scripts”). Reload Prism and see if that works.

Not just mGear, you should put there any other scripts or modules which will be used on your project. It is like that to help everyone in same project to have access to allowed/required plugins per project.

If same error occurs maybe there’s another reason causing it, because when I started working with Maya 2022 a couple weeks ago got similar errors and noticed having a bunch of ‘_ _ pycache _ _’ folders added to plugins inside that Custom Modules path.

Didn’t quite investigated further, just deleted those Pycache folders, wrote a custom launcher adding “PYTHONDONTWRITEBYTECODE=1” environment variable and pointed Prism to load Maya from it on Prism’s Project Settings menu.

Got no more errors after that but also still don’t know what was causing it. :pensive:
Could be something Python 2 vs. Python 3 related but I am just guessing about.

I hope it helps you to figure out a solution though.

1 Like

Thanks @G.Robert . That is helpful information. I will try it out :slight_smile:

1 Like

Hi @G.Robert , Can you please show what you wrote in .bat file? I find the following while going through custom step tutorial.

@Utkarsh_Agnihotri sure:

@echo off

set PYTHONDONTWRITEBYTECODE=1

rem MGEAR_SHIFTER_CUSTOMSTEP_PATH=
set MGEAR_SHIFTER_COMPONENT_PATH="X:\PROJECTS\ABC\00_Pipeline\CustomModules\Maya\scripts\mgear\shifter_abc_components"

set MAYA_NO_CONSOLE_WINDOW=1
set MAYA_NO_WARNING_FOR_MISSING_DEFAULT_RENDERER=1

start "" "C:\Program Files\Autodesk\Maya2022\bin\maya.exe"

Then saved it inside the Custom modules folder and set this on Prism Settings:

(Oh, in this image the ‘„’ signs are actually ‘’ Forgot to change it before screenshot).

1 Like

@G.Robert Thanks a lot. I will try it again :slight_smile:

It is working now. Thanks a lot :wink:

1 Like

Hello ! I would like to submit a fix related to the following warning when launching guide manager :

Warning: Custom component name: __pycache__, already in default components. Names should be unique. This component is not loaded

Inside scripts>mgear>shifter>guide_manager_component.py :
(line 94) : if comp_name == "__init__.py":
should be replaced by if comp_name in ["__init__.py", "__pycache__"]:

Even with the fix of @G.Robert, i may have some new __pycache__ folders and i think they shouldn’t be loaded by default.

Have a nice day !

1 Like