Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Replacing referenced file part way through script (https://simplymaya.com/forum/showthread.php?t=39984)

Iotrez 09-12-2013 10:34 AM

Replacing referenced file part way through script
 
Hi all,

I'm trying to put together a script which has several steps in it, and mid way through I want to have a referenced file (which is already in the scene) be replaced with a different file that the user specifies.

I think I want to be able to have an "open dialogue box come" up when the user first executes the script, so that they can specify the file they want to reference in. Then at the relevant point in the script have it replace the reference with their selection.

I read on another thread that this bit of script below can replace a referenced file with another one(in this case replacing a cube with a sphere):

file -loadReference "cubeRN" -type "mayaAscii" -options "v=0" "C:/desktop/sphere.ma";


But is there any way to have the script example above somehow link to a file that the user already specified though a dialogue box, instead of the actual line of code pointing to the specific file?

Please can anyone help with something like this?

Thanks.


All times are GMT. The time now is 05:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018