PDA

View Full Version : batch lightmapping


dutch_delight
12-01-2009, 02:43 PM
Hi all,

I've got to find a way to automate the rendering of lightmaps for a bunch of files. I've got most of it done but I'm struggling to make sense of mental ray. I've got this but it doesnt always save. Most of it is just copied from the listner window. Is there a better way of doing this?

I want to render each object, save out the targa file and move onto the next one.


string $selectionList = `ls -l -o`;
$file_base = "c:/";
for ($obj in $selectionList)
{
if (`nodeType $obj` == "mesh")
{
mrBakeCallback prelightMentalRayOptions 1;
convertLightmapSetup -camera persp -bakeSetOverride tmpTextureBakeSet -keepOrgSG -showcpv;
convertLightmap -camera persp -bo tmpTextureBakeSet initialShadingGroup $obj;
sysFile -copy ($file_base +"renderData/mentalray/lightMap/" +$obj +".tga")
($file_base +"renderData/mentalray/lightMap/baked.tga");
}
}



thanks

jaydru
12-01-2009, 05:14 PM
rich, rich, rich...
you should have just come down stairs and asked me, i'll have a look when i get a chance :)

dutch_delight
12-01-2009, 09:09 PM
I have no social skills.
:blush:

CGTalk Moderation
12-01-2009, 09:09 PM
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.