Select Material by name in SME

Hello everyone,
I try to select a material in Slate Mode Editor to delete it from the view.
My material to delete exist in the view and have an explicit name.
I don't find any solution to select material of the slate editor view by his name and delete it from the view.
I have you got some tips to realise this?

Many thanks
Bruno

Comments

Comment viewing options

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

Thank you very much

Thank you very much Swordslayer, this is exactly what i want!

Swordslayer's picture

 

matchName = "Material Name to select"
if sme.IsOpen() do
(
	local view = sme.GetView (sme.activeView)
	view.SelectNone()
	for i = 1 to view.GetNumNodes() where (n = view.GetNode i).reference.name == matchName do n.selected = on
)

Comment viewing options

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