Scripting In MG-Picker Studio
Scripting helps to build more powerful picker.
MG-Picker Studio enables you to design powerful picker even you know nothing about programming. Yet if you know MEL / Python scripting in Maya, you picker will become 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 Document Level callbacks
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.
An namespace changed command will be executed whenever the picker namespace is changed either by user or by api.
💡 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.
Three ways to edit the load / enter / Namespace Changed command
Go to
Pickermenu and selectEdit Picker Load & Enter Command..;Activate the edit tool, right click on empty area, select
Edit Picker Load & Enter Command..Go to
Pickerpanel.
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.
Other Scriptings
The 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.
The command button preset scripts, in future you could use them to create command buttons without coding.
The code snippets to be used in future to speed up the coding.
The 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.
Command References