[Closed] Custom Buttons for interface
Hello everyone, does somone knows if it is posible to create custom butons for a macroscript in Max´s interface?
Thanks.
David.
If I am understanding your question correctly, then yes, every MacroScript IS potentially a button in the Max interface.
Need more information that starts with “For example…” to answer in more detail…
Hi Bobo, U are right, I have atached a screenshot of what I have developed so far…
the thing is, I would like to have custom icons made, instead of the standard buttons with only text on them
thanks in advanced.
David.
Sure, there is an old, old script I wrote back in R3 days (the first version that allowed for custom icons to be created) and it shipped with Max for many years as a bonus script – not sure if it is still on the Max 9 DVD.
You can grab it from my site
http://www.scriptspot.com/bobo/mxs3/cim/MakeIcon_max4_55.zip
It appears under the Utilities tab in the MAXScript Utility > drop-down list.
(I should find some time to finally rewrite it, but I keep on using it as is and it works).
Basically, it lets you render your scene to icon files and paste them into new or existing icon files. The structure of icon files is described in the MAXScript Reference, too. In general, you have to provide a 24×24 and 16×15 version of the color bitmap with _i suffix and another set of _a files with exactly the same order but containing the alpha information.
The script creates all these (and the optional mask channel which is normally not used anymore) automatically. But you can design your icons in Photoshop or even MS Pain(t) if you follow the requirements.
Last but not least, Max 9 provides a method colorMan.reinitIcons() which lets you reload all icon files without restarting Max, so once you create your libraries, you can call that to refresh the caches.
To specify an icon directly in the macroscript, just add icon:#(“LibraryName”,Index) to the Macro definition, where “LibraryName” is the name of the library bitmap and Index is the index of the icon, for example
macroScript Test category:“Tests” icon:#(“TestIcons”,1)
(
)–end script
will assing icon 1 from the icon library named TestIcons. Or you can assing the icons via the right-click menu > Edit Button Appearance.
NOTE that the DIMaster script listed in my sig ships with its own icons – you can take a look at them to see how they were made. Same applies to many buttons in the MAXScript interface that ARE scripts…
Awsome Bobo, thanks a lot!! I´ll give it a try.
By the way, your “MaxScript for tha masses” DVD is great thanks for that to.
David.