ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Hello I would like to know how can I create a script that locates the scene objects depending of the object materials and names the layer depending of the material name... thanks for your help!
Great script, thanks for posting it.
Sometimes I have problems with it however. Max pops up an error about the addnode on the last line. I'm not experienced in scripting so any help would be great, thanks.
-- put objects onto layers one layer for each material and name the layer by the material name
-- by Olaf Finkbeiner for www.mainworks.de
layers = #()
obj = #()
for o in geometry where o.material != undefined do (append obj o)
m = scenematerials
c = m.count
for i = 1 to c do (
layername = m[i].name
layer = layermanager.newLayerFromName layername
for o in obj where o.material.name == m[i].name do (layer.addnode o)
)
Comments
Great script, thanks for
Great script, thanks for posting it.
Sometimes I have problems with it however. Max pops up an error about the addnode on the last line. I'm not experienced in scripting so any help would be great, thanks.
-- put objects onto layers
-- put objects onto layers one layer for each material and name the layer by the material name
-- by Olaf Finkbeiner for www.mainworks.de
layers = #()
obj = #()
for o in geometry where o.material != undefined do (append obj o)
m = scenematerials
c = m.count
for i = 1 to c do (
layername = m[i].name
layer = layermanager.newLayerFromName layername
for o in obj where o.material.name == m[i].name do (layer.addnode o)
)
Hi Mariano, i just looked
Hi Mariano,
i just looked for something that does that and could not find it... So i will write it now...
kind regards
Olaf