Home  Previous Next

转换器是用来将其它类型的picker节点、文件转换成mgpicker节点或文件的mel脚本。

转换器非常多地使用了由MG-Picker工作室提供的MEL API命令,主要是这三个命令:

MGPicker, MGPickerItem, MGPickerLink.

请参考这些命令的文档来了解它们的用法。

 

这些转换器MEL脚本放在哪里?

对于工具自带的转换器,是放在Maya的脚本文件夹/ MG-PickerStudio/MGPicker_Program/Converters里,

这些转换器由MG-Picker工作室维护所以最好不要去动它。

对于用户编写的转换器,请放在这里:Maya的脚本文件夹/MG-PickerStudio/MGPicker_UserConfig/Converters。

 

要学习如何编写一个转换器,请参考自带的两个mel转换器作为例子参考:

Converter_abxPicker.mel,  Converter_nickPicker.mel

 

假设您的转换器是为了转换otherPicker类型的picker节点或文件,则转换器mel脚本就叫做Converter_otherPicker.mel, 然后这个mel脚本里必须用global proc编写下面的接口函数:

//other picker node converter API:        

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

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

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

global proc string Converter_otherPicker_getNamespace(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_nodeLister(); //list all the picker nodes in the scene.

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

 

//other picker file converter API:        

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

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

                 

Home Previous Next