Hi guys,
I ran into a ‘module’ object has no attribute error when trying to execute a function in Maya through a custom menu. Looking for some help to sort this out.
env: Windows 7, Maya 2013
I set up a custom folder structure as below:
main_folder
script_folder
[INDENT]init.py[/INDENT]
[INDENT]function01.py[/INDENT]
userSetup.py
I then set up maya script environment variable to specify the path to the userSetup.py.
userSetup.py
def function01():
import script_folder
### menu creation stuff
cmds.menuItem(p=customMenu, l='function label', c='import script_folder;script_folder.fucntion01()')
init.py
import maya.cmds as cmds
try:
from function01 import *
except:
print 'something is wrong'
It seems to me the code is executed just fine as I am able to see and interact with the custom menu created in Maya until when I execute the function01, Maya throws me a ‘module’ object has no attribute ‘function01’ error. Did I not import the function01 properly or something?
Thanks!