Converters

Converters are a MEL script that converts other types of picker nodes/files into MG-Picker files/nodes.

The converters utilize the MEL API commands provided by MG-Picker Studio heavily, especially these 3 commands: MGPicker, MGPickerItem and MGPickerLink. Refer to the command reference for those commands to know more about these commands.

Where should these converter scripts be placed

For factory default converters, they are in the Maya's user script folder/ MG-PickerStudio/MGPicker_Program/Converters, the factory default converters are maintained by the developer of MG-Picker Studio so better keep them intact.

For user converters, please put them here: Maya's user script folder/MG-PickerStudio/MGPicker_UserConfig/Converters.

How to write a converter

To learn how to write a converter, check out the existing converters from the factory default converters folder: Converter_abxPicker.mel, Converter_nickPicker.mel

Example

Say your converter is for the otherPicker nodes, and the converter file is called Converter_otherPicker.mel, the interfaces that a converter mel should implement are:

// Other picker node converter API:

// Return 0~1 value, indicate if MG-Picker should invoke this converter to autoload 
// your in-scene picker node.
global proc int  Converter_otherPicker_autoReadNode();

// Return string value, the type string of picker node.
global proc string Converter_otherPicker_nodeType();

// Return 0~1 value, indicating  the node is of the picker node.
global proc int Converter_otherPicker_isPickerNode(string $node);

// Return the namespace from a picker node.
// The proc is used in find&Load feature of MG-Picker studio.
global proc string Converter_otherPicker_getNamespace(string $node);

// List all the picker nodes in the scene.
global proc string[] Converter_otherPicker_nodeLister();

// The actual reader for each picker node.
global proc int Converter_otherPicker_readNode(string $node);

 
//other picker file converter API:

//Return 1 if the file is the picker file, 0 if not. 
global proc int Converter_otherPicker_isPickerFile(string $fileFullPath);

// The actual reader for each picker file.
global proc int Converter_otherPicker_readFile(string $fileFullPath);