How to automatically execute python script when Maya first loaded
- by tep
Hi,
I am new to Maya and trying to figure out how to use Python in Maya. I wanted to create a shelf in Maya and when I click that shelf, it will execute a file containing python code.
First thing, I figured out that we can't simply "source" python script. I followed tutorial from http://www.rtrowbridge.com/blog/2008/11/maya-python-import-scripts/, so now I have a function psource(). In my shelf, I can just call psource("myPythonScript")
My problem is I have to somehow register psource() when Maya first loaded. Do you have any idea how to do this?
Thanks!