如何在{blend} shape编辑器中列出当前选择的项目?我尝试使用blendShapePanel,blendShapeEditor和shapeEditor查询以下字符串(面板,编辑器或窗口):
blendShapeEditorTreeViewSelection
shapePanel1
shapePanel1Window
但徒劳。
注意:我已经使用lsUI命令获得了上述名称
您可以使用MEL proc getShapeEditorTreeviewSelection
。要获取当前选择的混合形状:
getShapeEditorTreeviewSelection(1);
// Result: blendShape1 //
然后获取当前选定的目标:
getShapeEditorTreeviewSelection(4);
// Result: blendShape1.0 blendShape1.1 //
这将为您返回每个选定目标的混合形状和索引。要转换索引,我们可以这样做:
string $selectedTargetL[] = getShapeEditorTreeviewSelection(4);
string $convertedTargetL[] = {};
for($target in $selectedTargetL)
{
string $subStrings[] = stringToStringArray($target, ".");
$convertedTargetL[size($convertedTargetL)] = eval("aliasAttr -q " + $subStrings[0] + ".w[" + $subStrings[1] + "]");
}
print $convertedTargetL;
pSphere1
pSphere4
这将为您提供所有选定的内容。如果需要有关该命令的更多信息,则Autodesk在MEL whatIs getShapeEditorTreeviewSelection
列出的文件中提供了有关该proc的大量文档。我不确定是否可以在此处发布。
[我通过使用形状编辑器制作混合形状并在<maya install directory>/scripts
中搜索在脚本编辑器中回显的proc,然后搜索相似的命令来发现了该命令。
希望这会有所帮助!