PDA

View Full Version : Button on main toolbar run a small script


ghostlake114
06-07-2008, 07:18 PM
I want to make a button on main toolbar that run a small script (It is very short to make seperate macro file ;)). However, I can not figure how Max handle it. Edit a button dont give any area for putting script in.

Thanks for any help

Bobo
06-07-2008, 07:32 PM
I want to make a button on main toolbar that run a small script (It is very short to make seperate macro file ;)). However, I can not figure how Max handle it. Edit a button dont give any area for putting script in.

Thanks for any help

The only way to add a button anywhere in the UI is to create a short MacroScript.

macroScript yourScriptName category:"ghostlake114" buttontext:"ButtonName"
(
--your code here
)

Once you have evaluated it, go yo Customize UI > Toolbars and drag the button to the Main Toolbar. If you want an icon, you can assign an existing one using the Edit Button Appearance option or create your own icon BMP files (there is a documentation page explaining how) and specify in the macro definition.

ZeBoxx2
06-07-2008, 10:33 PM
well, that's not *entirely* true - but this is not beginner-level material and it's not very flexible; one can create a small dialog, register it as being dockable, then dock it somewhere in max. Unfortunately the only docking options are top/right/bottom/left without any precise positioning :)

thatoneguy
06-07-2008, 11:32 PM
well, that's not *entirely* true - but this is not beginner-level material and it's not very flexible; one can create a small dialog, register it as being dockable, then dock it somewhere in max. Unfortunately the only docking options are top/right/bottom/left without any precise positioning :)

Which is very handy for things like the "drop down button" I have on my toolbar...

Bobo
06-08-2008, 05:50 AM
well, that's not *entirely* true - but this is not beginner-level material and it's not very flexible; one can create a small dialog, register it as being dockable, then dock it somewhere in max. Unfortunately the only docking options are top/right/bottom/left without any precise positioning :)

I can see the request for "a button for a small script on the Main Toolbar".
I don't see anything about "a dialog docked in the UI"
So I stand by the truthfulness of my answer (as opposed to truthiness (http://en.wikipedia.org/wiki/Truthiness))

ZeBoxx2
06-08-2008, 12:44 PM
So I stand by the truthfulness of my answer (as opposed to truthiness (http://en.wikipedia.org/wiki/Truthiness))
I forgot to quote :)

The only way to add a button anywhere in the UI is to create a short MacroScript.
There ya go :)

Of course one could then argue that a docked dialog isn't really part of 'the UI', and the original question -was- regarding a toolbar, so both are truthful - depending on context ;)

CGTalk Moderation
06-08-2008, 12:44 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.