Home  Previous Next

MG-Picker Studio could helps you to design powerful picker even you know nothing about programming.

Yet if you know MEL / Python scripting in Maya, you picker will because way more powerful.
 

These are several places that your programming skills may helps:

- Programmable properties of picker item. All these script properties support both mel/python.

Picker's load command & Enter command: A load command and a enter command can be set for each picker file/node.

The load command will be executed once the picker file / node is loaded. It is a good practice to put all the support mel procedures / python functions, class, or some other script importing statement within it, since they will be sourced once after the picker loaded, then for each picker item, you can just invoke these procudure / functions. This will probably make the scripting in picker more confortable.

An enter command will be executed everytime the mouse hover enter the picker view. Only input light code for enter command, since it will executed frequently.

The enter command is for syncing the picker items states with the state of Maya scene. Check out the Sync Value With Maya section at the left.

lightbulb You don't need to manually sync the value of slider / attribute button, since it is done automatically whenever the mouse hover into the view.

 

2 ways to edit the load / enter command of current picker:

1.Go to "Picker" menu and select "Edit Picker Load & Enter Command..";

2.Activate the edit tool, right click on empty area, select "Edit Picker Load & Enter Command.."

 

Command-Button's command: The command will be executed when you LMB click and release within the command-button in animator mode.

To edit the command-button's command, activate the edit tool, select the command-button, go to attribute editor and MMB scroll to bottom, there is a code editor for editing the command property.

         

Attr-Button's change command:

Pre-Change Command: The command will be executed right before the maya attribute's value change.

It is a good chance to record some states before the attribute change. Usually use it before a ik/fk switch, to record the states of controls.

Post-Change Command: The command will be executed right after the maya attribute's value actually changes.

If the actual maya attribute not changed, this command won't be invoked.

Warning Be careful avoid dead-loop of change command, say:

attrButton1: edit attrButton2's attribute value in its change command.

attrButton2: also edit attrButton1's attribute value in its change command.

This will be a dead-loop and will crash maya probably.

 

Slider's change command: The command will be executed right after the slider attribute values actually change.

If the actually maya attributes not changed, this command won't be invoked.

 

Left / Right clicking menu of each picker item: Each picker item can be attached a maya menu / marking menu.

To edit its menu, select the picker button, and create/edit the menu in menu editor.

 

 

- Write converter to read and covert other type of picker node/file into MG-Picker node/file.

 Currently MG-Picker Studio comes with converter for abxPicker nodes and nickPicker nodes. Maya scene with these picker nodes will auto-loaded by default.

- Write command button preset scripts, in future you could use them to create command buttons without coding.

- Write code snippets to be used in future to speed up the coding.

- Write auto-sourcing script, put them into "maya/version/scripts/MG-PickerStudio/MGPicker_UserConfig/AutoSourced/" to be auto-source while MG-Picker Studio loads.

This mechanism enables you auto-source some scripts to support your picker functionality.

 

The main API MEL/Python commands provided by MG-Picker Studio are these:

MGPicker

MGPickerView

MGPickerItem

MGPickerLink

MGPickerMenu

MGPickerMenuItem

 

Beside these command, some more commands are also provided, but they are mainly for internal use:

MGPickerService

MGImageProcesser

* MGPickerValue: It is purely internal use. Used to support the undo/redo of the picker items in animator mode.

* MGPickerSetAttr: It is purely internal use.

* MGDockControl: It is purely internal use. Kinda the same as maya's dockControl command, with some extra features.

* MGPickerAttrSyncer: It is purely internal use. For syncing maya scene and picker state.

* MGPGuiTest: It is purely internal use for gui unittests.

 

Other programming related topics:

Command Button Presets

Converters

Code Snippets

Sync Value With Maya

Tips For Programmer

Home Previous Next