Getting selected index of a multimaterial

Hi everyone,

I'm trying to find a way to get the selected material in a multimaterial. More precisely, when you click a multi/sub material in the material editor, we are able then to click on the little preview of the material (within the multi / sub) and push "delete" to remove the selected material. This is the index I'm talking, the index of the selected material or the selected preview...

I can't find any properties on the multimaterial that could give me this value. So now I'm thinking to script a plug-in which could modify the multimaterial. The problem is I'm completely new to script a plug-in. Does someone have an idea how to get this index? Any advice will be more than apreciated.

Thanks

Comments

Comment viewing options

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

Is there a manner to modify

Is there a manner to modify the multimaterial plugin to get this value? I did write a lot of macroscript but I never touch plugin at all. I took a look to the help in max and I can see any fonction that could at least list me all variables, component, etc of the multimaterial ui interface (this could be helpful for any other type of plugin I guess)
Thanks again for your help.

Martin Côté
triademedia.ca

Martin Côté
triademedia.ca

macot392's picture

I did a script that

I did a script that automatically add a material modifier and assign the material on the selected objects if the material is a multimaterial, but before I have to show in a dropdown the list of the available ID, select one ID in the list and then apply.

but this would be cool to avoid the dropdown by only selecting the proper little preview in the multimaterial and then automaticcally apply the matching ID.

Martin Côté
triademedia.ca

Marco Brunetta's picture

Like I said, I don't think

Like I said, I don't think you can access the selected material. The best I can come out with is having the script be an UI extension of the multimaterial material. While you will still need the dropdown control, you will be able to see the different submaterials in the same interface.

Marco Brunetta's picture

I don't think there is a way

I don't think there is a way to access the selected material with maxscript. Maybe if you explain what you need this for I could suggest an alternative solution...

Comment viewing options

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