PDA

View Full Version : Unload reference


madscrawler
07-07-2005, 06:18 AM
I'm a MEL noob, working on my first script ever. I've got several references in my scene, and I need to write code so I can bring them in and take them out via the script. I've figured out how to bring them in--I just did it with the reference editor and copied the code from the script editor. That code looks like this:

pv_performAction "C:/Documents and Settings/Owner/My Documents/maya/projects/myProject/scenes/myScene.ma" "Best Guess";
file -r -type "mayaAscii" -gl -namespace "myScene" -options "v=0;p=17" "C:/Documents and Settings/Owner/My Documents/maya/projects/myProject/scenes/myScene.ma";

I have no idea what pv_performAction means, but it works. Anyway, when I unload or delete a reference via the reference editor, I don't get any code like that. I just get a bunch of stuff about filters and shaders.

So...anyone know how to write code that will unload or delete a reference? Thanks.

madscrawler
07-07-2005, 06:57 AM
Oh man, I'm sorry. It was so easy, it's embarrassing. I just checked the flags for the file command. Referencing in and out is a piece of cake.

file -r "C:/Documents and Settings/Owner/My Documents/maya/projects/myProject/scenes/myScene.ma";

...brings the reference in. And...

file -rr "C:/Documents and Settings/Owner/My Documents/maya/projects/myProject/scenes/myScene.ma";

...takes it out. Almost seems too easy. I'd better run some tests to make sure everything works. Thanks anyway.

CGTalk Moderation
07-07-2005, 06:57 AM
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.