Hi !
Looooong time ago, a buddy gave me that script to render objects with several material and save the still automatically with a name convention. Ideal for this routine
I would like to use it again but it’ll be more efficient if Vray frame Buffer,Vray color mapping and max gamma preference could be take into account. I mean, I would like to be able to use fully this script with Vray.
My problem is … I’m not a maxscripter ! and I don’t know if there is a easy way to do it…
Could you help me ?
Thanks.
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"
)
)
I’m not sure I understand what you’re trying to do.
Do you want to cycle through all your scene materials and render one image with all the objects with Material#1 then one image with all the objects with Material#2 then one image with all the objects with Material#3 etc.?
In fact, I’m already use this script in that way :
1-Create a “decor” group which been not affected by material changes and been always rendered.
2-Select objects and materials I want to associate in differents renders.
3-render them all !
So If I have a scene with box1/box2/box3 with material000 and material#1/material#2/material#…/material#25.
I can render :
- box1/box2 always with the same material000 and box3 with material#1 then save to “box3_mat#1.png” then,
- box1/box2 always with the same material000 and box3 with material#2 then save to “box3_mat#2.png” then,
- …
- box1/box2 always with the same material000 and box3 with material#25 then save to “box3_mat#25.png”.
So, this script is ok in that way but my problem is that It didn’t take in account all my stuff with VrayfB,Vray color mapping and max gamma preference, etc…
I don’t know why… that’s my request.
Sorry if I’m not clear… it’s no more in my mind !!
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
renderSceneDialog.close()
rendOutputFilename = outputpath + "\\" + nomobj + "_" + matname + ".png"
max quick render
)
)
messageBox "RENDER OK"
)
)
Obviously I can’t test it without the rest of your script.
Hi,
sorry for the delay, thanks Dan for the last version of the script, It works nicely !
I had a break with this job so I put it aside but it’s back again these days… and it came back with new demands…
Anyway, I handled almost all but again, I have a question about this script :
Could it be possible to get materials from a specific MatLib instead of taking them from Material Editor ? Idealy, if we could have the choice, it would be perfect !
I tried but I can’t understand how to call and get a specific matlib…