Home  Previous Next

Command button presets are a bunch of scripts to speed up the command button-creating process.

Those preset scripts enable you to create a command button without coding in the future.

In designer mode, with the edit tool editTool / command-button tool commandBtnTool activated, right-click on view, select Add command button menu,

activated, right-click on view, select Add command button menu,

the menu list out all the command presets, select one preset to create your command button,

the code in the preset will be the command of the command button, the file name will be the label of the button, except all the "_" is replaced with " ".

Furthermore,  if there is a .tooltip file beside the preset script file, with the same file name as the script file, the content of the .tooltip file will be the tooltip text of the created command button.

For example, if you get a command-button preset script called:

Keyframe_Changed_Channels.mel

and within the same folder you get:

Keyframe_Changed_Channels.tooltip

then if you create a command button based on the preset script, the button will have a label called "Keyframe Changed Channels", and a tooltip that is the content of the Keyframe_Changed_Channels.tooltip file.

 

How to create a command button preset?

Go to "Misc Menu / Create Presets/Code Snippets..", or in any code editing widget, click on the top-right triangle menu, and select "Export As Command Button Preset..".

In the pop-up dialog, input the category, the preset name, code, and tooltip text and create.

 

Where are those command button preset scripts?

For factory default preset scripts, they are in the Maya's user script folder/ MG-PickerStudio/MGPicker_Program/CommandButtonPresets,

the factory default preset scripts are maintained by the developer of MG-Picker Studio so better keep them intact.

For user command preset scripts, please put them here: Maya's user script folder/MG-PickerStudio/MGPicker_UserConfig/CommandButtonPresets.

 

Home Previous Next