Hey Folks,

I have pymel, installed via pip on Maya 2024, 

Pymel itself is working. But im having a really strange issue.

My studio menu is built with pymel...

I have a maya module..  
ib.mod - this then loads the plugin 
pipeline_module.py - very simple script for making a maya module / plugin

pipeline_module.py imports a maya file called pipeline_menu.py "My maya top 
bar menu"

this menu just holds all my tools etc. 

The module wont load via Maya's GUI "Plugin Manager" "just like you would 
load vray kind of setup.
This worked in Maya 2018 right through to 2023.
I need to run manually in the python interpreter "import pymel.core as pm"
This might sound simple but both the pipeline_module.py and pipeline.py 
files run import pymel.core as pm right at the top of both scripts.

Why am I now needing to run this before the module will load? 
The error points to menuOBJ

Error Messages...
'''
// Error: file: C:/Program 
Files/Autodesk/Maya2024/scripts/others/pluginWin.mel line 316: 
RuntimeError: file C:\Program 
Files\Autodesk\Maya2024\Python\lib\site-packages\pymel\internal\pmcmds.py 
line 217: menu: Object 'menuOBJ' not found.
// Warning: file: C:/Program 
Files/Autodesk/Maya2024/scripts/others/pluginWin.mel line 316: Failed to 
run file: C:/Users/Alistair 
Messom/IB/maya_pipeline/mod/plug-ins/pipeline_module.py
// Error: file: C:/Program 
Files/Autodesk/Maya2024/scripts/others/pluginWin.mel line 316: 
 (pipeline_module)
'''

My pipeline_menu.py script... well the top of it, the only part that calls 
or refers to menuOBJ is the string in variable menu_obj = 'menuOBJ'
'''
"""
PIPELINE MENU
"""
import maya.cmds as cmds
import pymel.core as pm 
import os

company_name = (
os.environ['CUSTOM_PIPELINE_NAME'])

def make_the_menu():

main_window = pm.language.melGlobals[
'gMainWindow']
menu_obj = 'menuOBJ'
menu_label = company_name

if pm.menu(
menu_obj, 
label=menu_label, 
exists=True, 
parent=main_window):
pm.deleteUI(pm.menu(menu_obj, e=True))
'''
Please not if I manually run "import pymel.core as pm"

Then activate the module with Maya's GUI "plugin Manager" it opens / works 
fine.
Are we looking at a bug here? 
I just don't get it!!

Thanks,


-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/1ade785e-46dd-4181-a2de-aab73c5e6527n%40googlegroups.com.

Reply via email to