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
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
