Guaranteed Hwrender File Save Location?

I'm building a UI that, as one feature, takes hardware snapshots of a custom viewport using hwRender. Unfortunately, I can't figure out where Maya will consistently put the images by default. I query the active workspace and that gets me close. Adding "images" to the end of the workspace path works most of the time, but sometimes Maya adds an additional subdirectory for the camera name and, in Maya 8.5, it uses tmp.

Is there something I can query or something I can override to ensure that the images are always save to the path of my choice?

I'm using Maya 7 at the moment and am switching to Maya 8.5 later today, but I'm guessing if there is a procedure out there, it would be the same.

Thanks,

Alec

You can know this, renders initiated within render or into render view are saved out in the images tmp file bexcause they are PREVIEWS, and don't count as full fledged render. Off course you can easily querry whats in the view port.

On the otherhand if your suing bach render it goes into images diorectory or whetever sub pass your putting it into.

Also when you ask the hwRender to render:

$file=hwRender;

it returns the filename so you don't need to guess or querry it at later date.

you can do something like this:

setAttr -type "string" defaultRenderGlobals.imageFilePrefix "C:/File";
hwRender -f 1 -cam persp

it wikll render to a file placed in c:/file_tmp.iff

There is porbably a way to get rid of the _tmp but i dont have time to read ALL the render nodes attributes trough.

Great! Thanks for the info. I hadn't thought about explicitly defining the path in the prefix.
I'll give it a go.

Thanks again,

Alec