Script - search by Material name

Im trying to write a maxscript that I can use to control the properties of its material by searching all the object in a scene with a material "name" like name_01, name_02,name03,... est. But what i currently have does not work.I just started playing with maxscript. Please help, Thanks!

Example --

for i in geometry do
if i.material.name == "Material_name_*" do
i.material.diffuse=black

Comments

Comment viewing options

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

Thanks miauu! It works.

Thanks miauu! It works.

miauu's picture

for i in geometry where

for i in geometry where matchPattern i.material.name pattern:"Material_name_*"  do
i.material.diffuse=black

Comment viewing options

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