Files
Nexus/2023/scripts/animation_tools/mgpicker/MGPicker_Help/SimplifiedChinese/converters.htm
2025-11-23 23:31:18 +08:00

78 lines
9.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<title>转换器</title>
<meta name="generator" content="Help &amp; Manual" />
<meta name="keywords" content="converters,picker converters" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
body { margin: 0px; background: #F8F8F8; }
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="helpman_settings.js"></script>
<script type="text/javascript" src="helpman_topicinit.js"></script>
<script type="text/javascript">
HMSyncTOC("index.html", "converters.htm");
</script>
<script type="text/javascript" src="highlight.js"></script>
<script type="text/javascript">
$(document).ready(function(){highlight();});
</script>
</head>
<body>
<table style="width:100%; border:none; border-spacing:0px; padding:0px; background:#D0D0D0">
<tr style="vertical-align:middle">
<td style="text-align:right">
<a href="welcome.htm"><img border="0" src="../common/images/MGtoolsHelp_Home.gif" width="34" height="22" alt="Home" /></a>&nbsp;
<a href="commandbuttonpresets.htm"><img border="0" src="../common/images/MGtoolsHelp_previous.gif" width="34" height="22" alt="Previous" /></a>
<a href="codesnippets.htm"><img border="0" src="../common/images/MGtoolsHelp_next.gif" width="34" height="22" alt="Next" /></a>
</td>
</tr>
</table>
<!-- Placeholder for topic body. -->
<table style="width:100%;border:none;border-spacing:0px"><tr style="vertical-align:top"><td style="text-align:left;padding:5px">
<p class="p_Normal" style="text-indent: 0; line-height: 1.80; padding-left: 13px; margin-left: 0;"><span class="f_Heading1" style="font-size:10pt; font-family: Arial,'Lucida Sans Unicode','Lucida Grande','Lucida Sans';display:inline-block;width:13px;margin-left:-13px">&#9642;</span><span class="f_Heading1" style="font-size: 10pt;">转换器是用来将其它类型的picker节点、文件转换成mgpicker节点或文件的mel脚本。</span></p><p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;"><span class="f_Heading1" style="font-size: 9pt; font-weight: normal;">转换器非常多地使用了由MG-Picker工作室提供的MEL API命令主要是这三个命令</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;"><a href="mgpicker.htm" class="topiclink">MGPicker</a>, <a href="mgpickeritem.htm" class="topiclink">MGPickerItem</a>, <a href="mgpickerlink.htm" class="topiclink">MGPickerLink</a>.</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;"><span class="f_Heading1" style="font-size: 9pt; font-weight: normal;">请参考这些命令的文档来了解它们的用法。</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;">&nbsp;</p>
<p class="p_Normal" style="text-indent: 0; line-height: 1.80; padding-left: 13px; margin-left: 0;"><span class="f_Heading1" style="font-size:10pt; font-family: Arial,'Lucida Sans Unicode','Lucida Grande','Lucida Sans';display:inline-block;width:13px;margin-left:-13px">&#9642;</span><span class="f_Heading1" style="font-size: 10pt;">这些转换器MEL脚本放在哪里?</span></p><p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;"><span class="f_Heading1" style="font-size: 9pt; font-weight: normal;">对于工具自带的转换器是放在Maya的脚本文件夹/ MG-PickerStudio/MGPicker_Program/Converters里</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;"><span class="f_Heading1" style="font-size: 9pt; font-weight: normal;">这些转换器由MG-Picker工作室维护所以最好不要去动它。</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;"><span class="f_Heading1" style="font-size: 9pt; font-weight: normal;">对于用户编写的转换器请放在这里Maya的脚本文件夹/MG-PickerStudio/MGPicker_UserConfig/Converters。</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 24px;">&nbsp;</p>
<p class="p_Normal" style="text-indent: 0; line-height: 1.80; padding-left: 13px; margin-left: 0;"><span class="f_Heading1" style="font-size:10pt; font-family: Arial,'Lucida Sans Unicode','Lucida Grande','Lucida Sans';display:inline-block;width:13px;margin-left:-13px">&#9642;</span><span class="f_Heading1" style="font-size: 10pt;">要学习如何编写一个转换器请参考自带的两个mel转换器作为例子参考</span></p><p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_abxPicker.mel, &nbsp;Converter_nickPicker.mel</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 48px;">&nbsp;</p>
<p class="p_Normal" style="text-indent: 0; line-height: 1.80; padding-left: 13px; margin-left: 0;"><span class="f_Heading1" style="font-size:10pt; font-family: Arial,'Lucida Sans Unicode','Lucida Grande','Lucida Sans';display:inline-block;width:13px;margin-left:-13px">&#9642;</span><span class="f_Heading1" style="font-size: 10pt;">假设您的转换器是为了转换otherPicker类型的picker节点或文件则转换器mel脚本就叫做Converter_otherPicker.mel, 然后这个mel脚本里必须用global proc编写下面的接口函数</span></p><p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">//other picker node converter API: &nbsp; &nbsp; &nbsp; &nbsp;</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">global proc int &nbsp;Converter_otherPicke</span><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">r_autoReadNode(); &nbsp; //return 0~1 value, indicate if MG-Picker should invoke this converter to autoload your in-scene picker node.</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">global proc string Converter_otherPicker_nodeType(); </span><span class="f_Heading1" style="font-size: 10pt; font-weight: normal;"> &nbsp;//return string value, the type string of picker node.</span></p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc int <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_isPickerNode(string $node); &nbsp; //return 0~1 value, indicate the node is of the picker node.</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc string <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_getNamespace(string $node); &nbsp; //return the namespace from a picker node. </p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;"><span style="width:26px;display:inline-block">&nbsp;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//The proc is used in find&amp;Load feature of MG-Picker studio.</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc string[] <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_nodeLister(); //list all the picker nodes in the scene.</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc int <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_readNode(string $node); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//the actual reader for each picker node.</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">&nbsp;</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">//other picker file converter API: &nbsp; &nbsp; &nbsp; &nbsp;</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc int <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_isPickerFile(string $fileFullPath); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Return 1 if the file is the picker file, 0 if not. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 22px;">global proc int <span class="f_Heading1" style="font-size: 10pt; font-weight: normal;">Converter_otherPicker</span>_readFile(string $fileFullPath); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//the actual reader for each picker file.</p>
<p class="p_Normal" style="line-height: 1.80; margin: 0 0 0 48px;"><span style="width:48px;display:inline-block">&nbsp;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
</td></tr></table>
<table height="30" width="100%" border="0" cellspacing="" cellpadding="0" bgcolor="#D0D0D0">
<tr valign="bottom" bgcolor="#D0D0D0" >
<td align="left" valign="middle" >
<a href="welcome.htm"><img border="0" src="../common/images/MGtoolsHelp_Home.gif" width="34" height="22" alt="Home" /></a>
<a href="commandbuttonpresets.htm"><img border="0" src="../common/images/MGtoolsHelp_previous.gif" width="34" height="22" alt="Previous" /></a>
<a href="codesnippets.htm"><img border="0" src="../common/images/MGtoolsHelp_next.gif" width="34" height="22" alt="Next" /></a></td>
</tr>
</table>
</body>
</html>