apply image on mapbutton

Hi Guys

I try to find how can I show the selected map from the material/map browser on the mapbutton (and not the name).

I know I need a filename to put image on the mapbutton, but the material/map browser don't return it, just something like this: "Map #1: checker"

So how can I use this to get the filename ?

Thanks in advance for any help :)

Comments

Comment viewing options

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

Yes, but in this case I add

Yes, but in this case I add some parameters to renderMap, that's why I used a variable :)

SugaR's picture

Thanks barigazy, you help me

Thanks barigazy, you help me a lot in this past few days.

Just a thing, you don't need to apply the map on a slot. This do the trick:

on mapbutton picked sel do
(
 local selRender = renderMap sel
 mapbutton.images = #(selRender, undefined,1,1,1,1,1)
)

I prefer to avoid use a medit slot when it's not necessary.

But still, a big thanks :)

barigazy's picture

...

You are good when you need to solve the problem with little help.
Sometime I need to wrote bunch of snippets someone to understand :)
Anyway if you don't want to use "selRender" variable then you can do it in one line

on mapbutton picked sel do
(
    mapbutton.images = #((renderMap sel), undefined,1,1,1,1,1)
)

bga

barigazy's picture

...

You neet to render active slot as bitmap an then use that image for your button.
Also look at this topic from mxs help
http://docs.autodesk.com/3DSMAX/14/ENU/MAXScript%20Help%202012/index.htm...

bga

Comment viewing options

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