Tuesday 2 April 2013

Setting environment variables in abxPicker

v0.3
I modified the source code. Feel free download it.
https://docs.google.com/file/d/0B0DVxItnSepALVZFeEdEY2J2TEU/edit?usp=sharing

Now you don't have to cahnge  the image path in Bg Image of pickerNode.
The script read the image path in a relative way.
ex.


Note. For existed pickerNode, just remove the path like "C:/Users/<username>/Documents/maya"


=======================================================================
v0.2
I was wrong.
The only way to do this is changed the script

Add those lines after line 637 string $bgImage = `getAttr ($node+".bgImage")`;


if (startString($bgImage, 12)=="MAYA_APP_DIR"){
string $bgImageArray[];
$bgImageArray = stringToStringArray($bgImage, "\\");
$bgImage = stringArrayRemoveAtIndex(0, $bgImageArray);
$bgImage=`getenv "MAYA_APP_DIR"`+"\\"+ stringArrayToString($bgImageArray, "\\");
print $bgImage;
}


That is you can use a image path like "MAYA_APP_DIR\projects\projectA\sourceimages" in Bg Image of pickerNode

MAYA_APP_DIR = C:/Users/<username>/Documents/maya

But if your interested in setting environment variables you can still take a look the below link.
Setting environment variables using Maya.env

=======================================================================
v0.1
I use abxPicker as one of my rigging tools. Now I need to pass the files to others. But the path for the Bg Image is absolute path "C:\Users\JiaPei\Documents\maya\projects\projectA\sourceimages"
And it is not convenience to  re-assigned the Bg Image of the abxPicker in every files while they are in different computer. The way to solve this is creating a  Maya.env file

Add a line like this :
MAYA_Projs_PATH = %MAYA_APP_DIR%\projects

Change the Bg Image dir in the abxPicker as
"MAYA_Projs_PATH\Documents\maya\projects\projectA\sourceimages"
That is I don't need to worry the different of the username.



2 comments:

Lord :p said...

HI! Thanks for your help, you seem the only person on the Internet who care about that! :)

I have a small question about this part of your explanation :
"MAYA_Projs_PATH\Documents\maya\projects\projectA\sourceimages"

I can't figure out where to put it
Cheers!

Jiapei Lu said...

Sorry for the late replying. It's been a while. And I don't have the soruce fiels right now. But I think you don't need to worry about the "MAYA_Projs_PATH\Documents\maya\projects\projectA\sourceimages"

Just change the source code like what I worte at begin. It shoule be work well. If you still have question. Just send me an e-mail.