Materials on selected object shown the same way as the Statistics?!

Hi all!

Is it possible with script to have the material of the selected object shown just like the Statistics (Poly amount etc etc, toggles by pressing the "7" key) do in the viewport?

Take care
/M

Comments

Comment viewing options

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

really cool mjbg !!!

really cool mjbg !!! Thanks :-)

do you know the color of the actual '[+][xxx][xxx]' text ?

Massemannen's picture

Thank u, mjbg, works

Thank u, mjbg, works great!
How can I control the size and position of the text, is that the 10,40,0 values?

Take care
M

mjbg's picture

here is an

here is an exemple:

unRegisterRedrawViewsCallback MaterialStatistics
fn MaterialStatistics =
(
try (MaterialName = "Material: "+$.material.name) catch(MaterialName = "Material:")
gw.wText [10,40,0] MaterialName color:yellow
gw.updateScreen()
redrawViews()
)
registerRedrawViewsCallback MaterialStatistics

I did only to show the material name.. of course you can develop this further to match your needs.

Comment viewing options

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