View Full Version : auto-matl library apply/object render

02 February 2009, 06:23 PM

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
MultiListBox matTorender "Materiaux:" items:(for o in meditMaterials collect
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 =
matname =
sortie = outputpath + "\\" + nomobj + "_" + matname + ".png"
render outputwidth:RenderWidth outputheight:RenderHeight outputFile:sortie vfb:myCheckBox.checked


messageBox "RENDER OK"


02 February 2009, 12:20 PM
I m not sure this script is "famous" :)
Anyway, check the list target (meditMaterials) and try to replace by the material library script name. How to know the script name? use the script recorder!

I will look this further

02 February 2009, 02:31 PM
yes, you're right.... that's not a famous script ;)

anyway, it's really useful for me ! thx, I will check this way and let you know...

02 February 2009, 02:42 PM
en fait je l'ai fait c'est assez simple. et j'ai meme ajouté un bouton REFRESH pour mettre a jour lors des changements d'objets dans la scene ou de matlib.
Je te laisse chercher par toi meme! t'es pas sur icq??

CGTalk Moderation
02 February 2009, 02:42 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.