alright it works now with : from _SAMA_LIB.PY.OpenGL import SAMA_ExportToOpenGL as testtest.SAMA_ExportToOpenGL() Thank you a lot! I am updating my script now but I have a set of error,conflict, problem etc... and I cannot launch several time the same following command from Maya... I Need to restart maya for each test :…
Does someone know how to import multi sub directories with *.py and *.pyw files with python? For exemple to import my mel script lib I am using the following mel script code : // ================== global proc LoadLib (string $libsToLoad[]) { string $dir = `internalVar -userScriptDir` + "_SAMA_LIB/MEL/"; for ($lib in…
Just tried this in my Maya scripts folder myCode -__init__.py(*) -code -testCode.py -__init__.py (*)In the init put this line: import code.testCode as testCode So to call a function within the testCode.py you can go import myCode myCode.testCode.myFunc() Or within Maya you can go: from myCode import testCode as tc…
Ok let's choose the following one: -|scripts (Maya defaul scripts directory) ---|_SAMA_LIB|PY|OpenGL|SAMA_ExportToOpenGL.py Maybe easier like this> "C:\Users\sama\Documents\maya\2009-x64\scripts\_SAMA_LIB\PY\OpenGL" The right command to import the SAMA_ExportToOpenGL.py file with his function is : from _SAMA_LIB.PY.OpenGL…
I tried these different combination once I did a clean"import" : from _SAMA_LIB.PY reload(LoadLib) as testtest.LoadLib("OpenGL")# Error: ('invalid syntax', ('<maya console>', 2, 24, 'from _SAMA_LIB.PY reload(LoadLib) as testn'))# File "<maya console>", line 1# from _SAMA_LIB.PY reload(LoadLib) as test# ^# SyntaxError:…