ScriptSpot

Forum topic · Scripts Wanted

Multi/subobject name to material name

By leonfortt · 2008-10-29

Description

Does anybody know of a script that will automate the copying of the mutisubobject name into the corresponding material name and/or vice versa.

Or... does anyone fancy having a go at creating this extremely useful bit of script? Sure you'd be very popular if did.

Many thanks

:-L

Comments (4)

inigomontoya · 2009-09-12

Anton,

This will save me time, not to mention irritation. Thanks so much. Plus it's simple enough for my wee brain to understand. Just might look into learning a little scripting. Teach a man to fish...

Do you have a paypal account? I'd love to buy you a beer or two. :)

Anton Berg · 2009-09-24

Haha a beer is always nice! Glad it helped.

I have a donation button on my page ... but I am just glad it helped you. My knowledge is mainly based on other sites that helped me when I started this. So hopefully I can copy one of your scripts in the future!

Anton Berg · 2008-11-12

This snippet takes the materialname and puts in the nameslot of the multisubObject material

To use this... copy paste this between the "-----" and into a new script in 3dsmax. press CTRL+E to evaluate the script when you have a object with multisub material selected.

Select a object that has a multisubobject material applied to it and run the script. You

------- start snippet

--get the material of the currently selected object
myMaterial = $.material

for i = 1 to myMaterial.count do
(
--this line copies the material name to the name slot
myMaterial.names[i] = myMaterial[i].name

--if you want to do the opposite do this
--myMaterial[i].name = myMaterial.names[i]
)

------- end snippet