rikou
02-19-2009, 05:23 PM
Hi,
http://forums.cgsociety.org/showthread.php?f=98&t=225187
I took this famous script (thx Loran ! as usual... ) for this kind of job (a lot of models to render in a lot of different matl) and it was great but now, I would like to do the same thing with more than 24 matl. Instead of selected the 24 matl from the material editor, I would like to indicate matl library.... So I will be able to render all my models with a indeterminate number of mtl !
Thx !
Here the code :
....
MultiListBox objectTorender "Objects:" items:(for o in objects collect o.name)
MultiListBox matTorender "Materiaux:" items:(for o in meditMaterials collect o.name)
checkbox myCheckBox "Rendered Frame Window" checked:false
label label6d "======================="
Button vasy " RENDER THEM ALL!! "
label label7d "======================="
on vasy pressed do
(
outputpath = GetSavePAth "Sauver dans : "
for obji in objectTorender.selection do
(
-- print objectTorender.items[obji]
obj = getnodebyname objectTorender.items[obji]
max unhide all
select obj
max hide inv
for dec in $decor do
(
unhide dec
)
for mati in matTorender.selection do
(
obj.material = meditMaterials[mati]
nomobj = obj.name
matname = obj.material.name
sortie = outputpath + "\\" + nomobj + "_" + matname + ".png"
render outputwidth:RenderWidth outputheight:RenderHeight outputFile:sortie vfb:myCheckBox.checked
)
)
messageBox "RENDER OK"
)
)
http://forums.cgsociety.org/showthread.php?f=98&t=225187
I took this famous script (thx Loran ! as usual... ) for this kind of job (a lot of models to render in a lot of different matl) and it was great but now, I would like to do the same thing with more than 24 matl. Instead of selected the 24 matl from the material editor, I would like to indicate matl library.... So I will be able to render all my models with a indeterminate number of mtl !
Thx !
Here the code :
....
MultiListBox objectTorender "Objects:" items:(for o in objects collect o.name)
MultiListBox matTorender "Materiaux:" items:(for o in meditMaterials collect o.name)
checkbox myCheckBox "Rendered Frame Window" checked:false
label label6d "======================="
Button vasy " RENDER THEM ALL!! "
label label7d "======================="
on vasy pressed do
(
outputpath = GetSavePAth "Sauver dans : "
for obji in objectTorender.selection do
(
-- print objectTorender.items[obji]
obj = getnodebyname objectTorender.items[obji]
max unhide all
select obj
max hide inv
for dec in $decor do
(
unhide dec
)
for mati in matTorender.selection do
(
obj.material = meditMaterials[mati]
nomobj = obj.name
matname = obj.material.name
sortie = outputpath + "\\" + nomobj + "_" + matname + ".png"
render outputwidth:RenderWidth outputheight:RenderHeight outputFile:sortie vfb:myCheckBox.checked
)
)
messageBox "RENDER OK"
)
)
