Postrender: how to get the rendered filename, in batch render

hi all,

I have stumbled upon a show-stopper, which should probably be quite easy, but I can't find a solution:

In a post-render script, I need to get the filename of the just-rendered file, so I can let some external command loose on it.
This should work in batch-render, of course, because it is meant to process a lot of files.

The idea is to launch a custom program per rendered file, that takes the filename of the rendered file, and stuffs extra information (like the current camera matrix, focal length etc.) into the file (or writes a companion file, whichever works better... stuffing extra metadata in an .exr file would be ideal... I already have a tool to do that, it's commandline-driven so I can call it from MEL... if only I had that filename to pass as a parameter.)

So the whole idea is: while still in the PostRender script, how do I get the filename of the frame that just got rendered?

it's puzzling me...

As a test, I tried to put this in a postrender script, but it doesn't write out files per frame ;-(

(as far as I can see, currentime -q is _not_ the answer (??) just try)

////////////////////////////////////////////////////
$frame = currentTime -q;
string $filename = "C:/temp/test_" + $frame + ".txt";
print($filename);
int $file = fopen $filename "w";
fprint $file ("This is a little companion test file for frame " + $frame);
fclose $file;
////////////////////////////////////////////////////

anyone?

greetz!
loki

The renderSettings command can provide the information you're looking for.

actually it may be quite involved if you use passes etc.

Hi Michiel, hi Joojaa,

you just made my day!

as Joojaa pointed out in a different thread about the same subject, I made the mistake of simply putting my test-script in the wrong 'post render' box (it should have been the 'post frame' box, no wonder I was seeing nothing.. it was also 4 a'clock at night... hum, let's blame the time :wink:

The rendersettings indeed provide enough info for getting the file name, and glueing the current time on.

Thanks a lot guys, for your very swift replies, and having patience with a Maya-beginner.  Normally, I just program, but I was asked to script some tools together, and the platform is quite new to me.
This forum really rocks!

Now I can continue to call my commandline exr-metadata-injection tool on the 'post frame' command, and stuff the camera matrix, etc. in the just-rendered frame... so the guys at the studio can pick it up from each frame in their compositor and auto-sync the compositing-camera to the actual maya camera.   I will probably hit a snag still, here and there, but hey, I have an opening now.

yeeeehaaaa!
and a jolly good day :wink:
loki

err isnt there  a easier way to do this than to actually dump data on disk?