ScriptSpot

Forum topic · General Scripting

How check material object

By Michele71 · 2010-09-17

Description

Hi

The question is very simple:

How do I understand the material applied to an object?

I have a box with any type material (standard, Mentalray etc.) in viewport. Now I want analyze the box and find what type of material is applied. How to do this?
I have not found anything on MaxScript help...

Thanks in advance

Comments (3)

Anubis · 2010-09-17

If the result is Undefined, maybe the object has not material or is unselected.

Michele71 · 2010-09-17

Yes Anubis:

With $Box01.material I have type of material and number of slot :)
With ClassOf $Box01.material only type of material.

A big Thanks Anubis!!

P.S. Before writing this post for help, I tried "$.material" but the result is "Undefined"...Why???

Anubis · 2010-09-17

Is this - "$Box01.material" or maybe this - "ClassOf $Box01.material" ?