Assign material keepeng the name of the previos one

The situation: There's material 'A' in a current mat editor slot and there's selected object with material 'B' assigned.
Would it be possible (via script) to assign mat 'A' to the selected object KEEPING the name of an old material ('B')
Thank you for attention

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
1rv's picture

Many thanks, I'll test it

Many thanks, I'll test it ASAP

jahman's picture

.

Sure it is possible. But unlike default max Assign Material to Selection it won't check whether material with such name already exists in the scene, and thus you may end up with lots of different materials sharing same name.

meditMaterials[activeMeditSlot].name = selection[1].material.name
selection.material = meditMaterials[activeMeditSlot]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.