How to automatically execute python script when Maya first loaded

Posted by tep on Stack Overflow See other posts from Stack Overflow or by tep
Published on 2010-05-31T16:58:20Z Indexed on 2010/05/31 17:03 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

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!

© Stack Overflow or respective owner

Related posts about Development

Related posts about game