"Clear Materials from Selected" command? (Is this right?)

Embarrassingly enough, I've tried for the past couple days to write a simple script for this but I've realized I'm hopelessly bad at maxscript. Shouldn't this work if I ran it?

macroScript ClearMaterialSelected

category:"# Scripts"

toolTip:"Clear Material"

(

 $. mat = null

)

 

 

AttachmentSize
clearmaterial.mcr105 bytes

Comments

Comment viewing options

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

.

(
	if selection.count != 0 do selection.material = undefined
)
kinggambit's picture

Ay! works like a charm. Thank

Ay! works like a charm. Thank you.

Swordslayer's picture

 

You don't even need the if test if using selection. I think the original problem might be confusing what scripts vs macroscripts do, macro will do 'nothing' when run as a script, it will only register an action that can be called from global search, assigned hotkey or UI item

Comment viewing options

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