ScriptSpot

Forum topic · Scripts Wanted

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

By kinggambit · 2017-12-05

Description

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

)

 

 

Attachments
Comments (3)

.

miauu · 2017-12-07


(
	if selection.count != 0 do selection.material = undefined
)

Swordslayer · 2017-12-08

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

kinggambit · 2017-12-09

Ay! works like a charm. Thank you.