From: Gary Jaeger <gary@(email surpressed)> Subject: file paths for .mi files Date: Wed, 31 Jan 2007 17:41:50 -0500 |
Msg# 1467 View Complete Thread (7 articles) | All Threads Last Next |
|
From: Greg Ercolano <erco@(email surpressed)> Subject: Re: file paths for .mi files Date: Wed, 31 Jan 2007 18:14:35 -0500 |
Msg# 1468 View Complete Thread (7 articles) | All Threads Last Next |
(or if anybody knows a way to force maya to write them the way I want in the first place. I haven't been able to find any way to do that) This newsgroup item from last summer might help you: http://seriss.com/cgi-bin/rush/newsgroup-threaded.cgi?-view+1312 When I make .mi files on the mac using absolute paths for textures, etc they always end up starting wtih /Volumes/foo. I've gotten used to using BBedit to batch replace /Volumes/ with //corefileserver/ so that the pc's can render the files, but is there any way in rush to sayfor this .mi file, use //corefileserver/ instead of /Volumes/ wherever it appears? Yes, you can do all that in perl, if the above newsgroup article on the 'dirmap' MEL command doesn't help you. In fact, the current submit-mray.pl script does a search/replace on the entire MI file to jam the output directory into incremental mi files, because ray's stinky -file_name flag only applies the change to the first frame in the incremental mi file, and doesn't apply to the rest of the frames. So the submit script makes a copy of the MI file in the rush tmp directory ($ENV{RUSH_TMPDIR}) applying a regex replace to all lines in the file as it creates the copy. See the ModifyMIOutputDir() function in submit-mray.pl. You can just make a copy of that function, and just change the function name, and the bit of code inside the while() loop to apply the regex you need. Here's how I'd do it: ---- snip # CHANGE ALL INSTANCES OF /Volume/ -> //corefileserver/ # $1 - src mi file # $2 - dst mi file # sub FixMIFile($$) { my ($src,$dst) = @_; unless ( open(SRC_MI, "<$src") ) { print STDERR "--- FAILED: open $src for read: $!\n"; exit(1); } unless ( open(DST_MI, ">$dst") ) { print STDERR "--- FAILED: open $dst for write: $!\n"; exit(1); } # BIN MODE (FOR WINDOWS) binmode(SRC_MI); binmode(DST_MI); while (<SRC_MI>) { s%/Volumes/%//corefileserver/%g; # /Volumes/foo -> //corefileserver/foo.. print DST_MI $_; } unless(close(SRC_MI)) { print STDERR "--- FAILED: close($src): $!\n"; exit(1); } unless(close(DST_MI)) { print STDERR "--- FAILED: close($dst): $!\n"; exit(1); } } ---- snip This makes a big assumption that all instances of the word '/Volumes/' can be globally replaced with '//coreserver/' to make things work. (This might be bad if one of the user's pathnames has a subdirectory somewhere in the middle of the pathname called '/Volumes', but hopefully you can avoid that) So in the code, instead of rendering the original MI file with eg: system("ray $miflags $mifile"); ..you might change that to read: # FIX MI FILE FIRST, MAKING LOCAL COPY, *THEN* RENDER THE COPY FixMIFile($mifile, "$ENV{RUSH_TMPDIR}/foo.mi"); system("ray $miflags $ENV{RUSH_TMPDIR}/foo.mi"); ..don't worry about removing the copy, rush will do that for you automatically when the frame finishes, as rush blows the entire $ENV{RUSH_TMPDIR} when the frame finishes or is dumped/requeued. -- Greg Ercolano, erco@(email surpressed) Rush Render Queue, http://seriss.com/rush/ Tel: (Tel# suppressed) Fax: (Tel# suppressed) Cel: (Tel# suppressed) |
From: Gary Jaeger <gary@(email surpressed)> Subject: Re: file paths for .mi files Date: Wed, 31 Jan 2007 18:48:18 -0500 |
Msg# 1469 View Complete Thread (7 articles) | All Threads Last Next |
|
From: Greg Ercolano <erco@(email surpressed)> Subject: Re: file paths for .mi files Date: Wed, 31 Jan 2007 19:39:09 -0500 |
Msg# 1470 View Complete Thread (7 articles) | All Threads Last Next |
Gary Jaeger wrote: In that newsgroup item there's a reference to "This can go in a startup file and reset paths:" I assume that's Maya.env? No, I think Bill meant it should go into one of maya's own startup mel scripts, eg: /usr/autodesk/maya8.5/scripts/startup/initialStartup.mel ..since dirmap is a mel command. Maya.env is for environment variables.. not the same as mel. Regarding sumbit-mray, does it always make a copy in the local tmp dir? No, I think it only does it when it detects the MI file is an incremental file. I'm submitting .mi files. Are your lines between the "snips" something I can put in my submit-mray anywhere? Yes, that's the idea. Let me know if I'm missing something, I was hoping I was pretty clear about adding that function to the script, and then tweaking the part of the script that runs the renderer to call the function first, then render the copy. -- Greg Ercolano, erco@(email surpressed) Rush Render Queue, http://seriss.com/rush/ Tel: (Tel# suppressed) Fax: (Tel# suppressed) Cel: (Tel# suppressed) |
From: Greg Ercolano <erco@(email surpressed)> Subject: Re: file paths for .mi files Date: Wed, 31 Jan 2007 19:43:21 -0500 |
Msg# 1471 View Complete Thread (7 articles) | All Threads Last Next |
I'm submitting .mi files. Are your lines between the "snips" something I can put in my submit-mray anywhere?Yes, that's the idea. Let me know if I'm missing something, I was hoping I was pretty clear about adding that function to the script, and then tweaking the part of the script that runs the renderer to call the function first, then render the copy. BTW, if you're just not sure what to do with those snippets I'd sent you, email me (via private email) a copy of your submit-mray.pl script as an attachment, and I can retrofit those snippets in there for you and mail them back. But first, give the dirmap thing a try. I would think you can experiment with that just by loading up maya, and typing those dirmap commands into the MEL prompt, then load/save your files to see if it does what you expect. Definitely refer to maya's own MEL docs on the dirmap command for more info on what it does and how it works. It does sound like the 'right way' to do what you want. Do the perl script hack only if the right way doesn't work. -- Greg Ercolano, erco@(email surpressed) Rush Render Queue, http://seriss.com/rush/ Tel: (Tel# suppressed) Fax: (Tel# suppressed) Cel: (Tel# suppressed) |
From: Andrew Kingston <andrew@peerless.co.uk> Subject: Re: file paths for .mi files Date: Tue, 27 Feb 2007 10:08:54 -0500 |
Msg# 1482 View Complete Thread (7 articles) | All Threads Last Next |
Gary Jaeger wrote: When I make .mi files on the mac using absolute paths for textures, etc they always end up starting wtih /Volumes/foo. I've gotten used to using BBedit to batch replace /Volumes/ with //corefileserver/ so that the pc's can render the files, but is there any way in rush to sayfor this .mi file, use //corefileserver/ instead of /Volumes/ wherever it appears?(or if anybody knows a way to force maya to write them the way I want in the first place. I haven't been able to find any way to do that). . . . . . . . . . . . Gary Jaeger // Core Studio 86 Graham Street, Suite 120 San Francisco, CA 94129 (Tel# suppressed) http://corestudio.com <http://corestudio.com/> HiI could be missing something, but couldn't you just use the MI_RAY_SUBSTITUTE environment variable when you render the mi. ### MI_RAY_SUBSTITUTEAn optional list of blank-separated substitution instructions, each in the form /search/replace/. Any other character besides / will also work. ###We've used this before to change texture paths from remote servers to local drives in order to stop the server from getting overloaded & our network getting choked. Cheers Andrew |
From: Greg Ercolano <erco@(email surpressed)> Subject: Re: file paths for .mi files Date: Tue, 27 Feb 2007 13:52:39 -0500 |
Msg# 1483 View Complete Thread (7 articles) | All Threads Last Next |
Andrew Kingston wrote: [posted to rush.general] Gary Jaeger wrote:When I make .mi files on the mac using absolute paths for textures, etc they always end up starting wtih /Volumes/foo. I've gotten used to using BBedit to batch replace /Volumes/ with //corefileserver/ so that the pc's can render the files, but is there any way in rush to sayfor this .mi file, use //corefileserver/ instead of /Volumes/ wherever it appears?(or if anybody knows a way to force maya to write them the way I want in the first place. I haven't been able to find any way to do that). . . . . . . . . . . . Gary Jaeger // Core Studio 86 Graham Street, Suite 120 San Francisco, CA 94129 (Tel# suppressed) http://corestudio.com <http://corestudio.com/>HiI could be missing something, but couldn't you just use the MI_RAY_SUBSTITUTE environment variable when you render the mi.### MI_RAY_SUBSTITUTEAn optional list of blank-separated substitution instructions, each in the form /search/replace/. Any other character besides / will also work.###We've used this before to change texture paths from remote servers to local drives in order to stop the server from getting overloaded & our network getting choked. Yes, that will probably work as well, as that appears to solve the problem at the mentalray end of the pipeline, instead of at the maya end. Maybe easier in some ways, too, as you can just jam that environment variable into the submit script, instead of having to add 'dirmap' mel commands to all the Maya start up files. Note: for info on 'dirmap', see the original posting on that: http://seriss.com/cgi-bin/rush/newsgroup-threaded.cgi?-view+1312 The one nice thing about dirmap, though, is that pathname fixes are applied at the head of the render pipeline, before the scene is loaded. This way if maya needs to load any of the data, the dirmap will correct the filenames before the data is used by maya. (Or that's how it's supposed to work, anyway) -- Greg Ercolano, erco@(email surpressed) Rush Render Queue, http://seriss.com/rush/ Tel: (Tel# suppressed) Fax: (Tel# suppressed) Cel: (Tel# suppressed) |