The userSetup.py is run each when maya is being started. You can have several userSetup.py files in your PYTHONPATH, but just one userSetup.mel.
If you want to make the userSetup file clean you can call other .py files from within the userSetup using execfile(). But you can also run your code directly in it. I hope that gets you started, Arvid Schneider Look Develpopment | Lighting TD | Show TD www.arvidschneider.com > On Oct 5, 2015, at 05:51, Christopher. <[email protected]> wrote: > > The execfile() is located in my userSetup.py script, I was informed to put it > there, another reason why I must learn Python soon, getting tired of the > sloppy coding by some programmers, and when you don't know what is going on, > you're led around by the nose. > > I want to add a script to automatically run when Maya starts ? > >> On Sunday, October 4, 2015 at 7:34:36 PM UTC-4, Justin Israel wrote: >> >> >>> On Mon, Oct 5, 2015 at 12:28 PM Christopher. <[email protected]> wrote: >>> How do you add a script to the userSetup.py file. Do you do it place after >>> the - execfile('') ? >>> >>> Then define it as such >>> >>> def menuImport(); >>> import <scriptName> >> >> Which execfile() call are you referring to? userSetup.py is something that >> gets automatically run by Maya at startup. It is just a normal python script. >> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/d229cd66-2267-46f1-b4e0-0c3a632f268f%40googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/a6c927bf-6638-4f6e-8a25-bae7b89773e8%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6FFB8CBD-E849-44BC-9B3A-EE9A45391D59%40gmail.com. For more options, visit https://groups.google.com/d/optout.
