Hi,
I ran into a wall when trying to implement Python UI callbacks in Maya. Looking for some help to sort this out.
env: Windows 7, Maya 2013
I set up a custom folder structure as below:
root_folder
An environment variable is specified with the path pointing to the userSetup.py.
userSetup.py
__init__.py
function01.py
It seems to me the code is executed just fine as I am able to see and interact with the custom menu 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!
I ran into a wall when trying to implement Python UI callbacks in Maya. Looking for some help to sort this out.
env: Windows 7, Maya 2013
I set up a custom folder structure as below:
root_folder
vray_script_folder
__init__.py
function01.py
function02.py
function03.py
userSetup.py
An environment variable is specified with the path pointing to the userSetup.py.
userSetup.py
Code:
def sampleFunction(): import vray_script_folder ### menu creation stuff cmds.menuItem(p=customMenu, l='function label', c='import vray_script_folder; vray_script_folder.function01()') cmds.menuItem(p=customMenu, l='function label', c='import vray_script_folder; vray_script_folder.function02()')
Code:
import maya.cmds as cmds try: from function01 import * from function02 import * except: print 'something is wrong'
Code:
import maya.cmds as cmds def function01(arg1, arg2): cmds.setAttr(stuff) cmds.setAttr(stuff2)
Thanks!
Comment