Python("execfile(\" <user scripts folder> /test.py\")");

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
Python("execfile(\" <user scripts folder> /test.py\")");

I added the following code as an execute-on-open/close script node for a character rig.

python("execfile(\"c:/Users/Me/Documents/maya/2013-x64/scripts/menu.py\")");

That is an absolute file path and works for me just fine.

I need to share the rig so how do I code it for aiming at other people's user scripts folder so people who get the rig on either a PC or MAC have no troubles?

Cheers

Last edited by egglybagelface : 01 January 2013 at 06:57 AM.
 
Old 01 January 2013   #2
With all the geniuses around I figured "user script directory" in python for multiple OSes would be easy.

Maybe i should set my MEL learning aside, and study python.

Last edited by egglybagelface : 01 January 2013 at 11:54 AM.
 
Old 01 January 2013   #3
Take a look at the internalVar MEL command, more specifically:
internalVar -userScriptDir;
 
Old 01 January 2013   #4
Thanks, Chris.
The creator of Blue Pencil, himself! I use it every shot I do.

I'm about a decade away from your level of programming expertise. Gotta dumb it down a little more.

Yeah for an ALL mel script I know how's used and applied.

But I dunno how to apply that to python wrapped in mel.

Last edited by egglybagelface : 01 January 2013 at 01:41 PM.
 
Old 01 January 2013   #5
If you're just making a single python call inside of a MEL script, this should be what you are looking for:
$userScriptDir= `internalVar -userScriptDir`;
python("execfile(\"" + $userScriptDir+ "menu.py\")");
 
Old 01 January 2013   #6
Ahhh! Nice, man!

I was so close!

I now know I coded correctly at one point but i had the main file open in another app and maya was returning errors cause it couldn't get rights.
 
Old 01 January 2013   #7
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:04 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.