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

Become a member of the CGSociety

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

Thread Tools Display Modes
  01 January 2013
Python("execfile(\" <user scripts folder> /\")");

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


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?


Last edited by egglybagelface : 01 January 2013 at 06:57 AM.
  01 January 2013
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.
  01 January 2013
Take a look at the internalVar MEL command, more specifically:
internalVar -userScriptDir;
  01 January 2013
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.
  01 January 2013
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+ "\")");
  01 January 2013
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.
  01 January 2013
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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
Society of Digital Artists

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

All times are GMT. The time now is 08:19 PM.

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