如何将消息属性的字段从另一个节点添加到属性编辑器?

How do I add a field for a message attribute from another node to the Attribute Editor?

假设我有 3 个节点,分别称为 GrandParent、Parent 和 Child。 Child 连接到 Parent,Parent 通过 Message 属性连接到 GrandParent。

我想在引用 Child 的 GrandParent 的属性编辑器中添加一个自定义字段。基本上,Parent 的消息属性字段接收到 Child 的连接,但在 GrandParent 中显示该字段。

它看起来像您在 AEParentTemplate.mel 中使用 editorTemplate -label "Brush Details" -addControl "child"; 得到的结果,其中 child 是用于连接子节点的 Message 属性。

除了我想将它添加到 GrandParent 的属性编辑器中。

我使用 AEGrandParent.mel 中的 editorTemplate -callCustom "parent_new" "parent_replace" 设法将其他属性从 Parent 添加到 GrandParent。在 parent_new 我创建了一个虚拟父节点

string $dummyParent = `createNode -skipSelect "Parent"`;

并且我用它来将Parent中的字段添加到GrandParent的属性编辑器中。例如 attrFieldSliderGrp -attribute ($dummyParent + ".numericValue") 在 Parent 中为名为 numericValue 的浮点属性添加一个字段和滑块。我可以用 attrColorSliderGrp -label $tmpStr -attribute ($dummyParent + ".color")

对颜色属性做同样的事情

然后在 parent_new 结束时,我删除了临时节点,并通过更新字段的属性引用(例如 attrFieldSliderGrp -e -attribute "parentNode1.numericValue" "parentNumericValueField";).

我的问题是我找不到如何对 Message 属性执行相同的操作。我尝试使用 attrFieldGrp -attribute ($dummyParent + ".child"); 创建一个 attrFieldGrp,但这会导致 Maya 2014 崩溃。我尝试使用 attrControlGrp attrControlGrp -attribute ($dummyParent + ".child"); 进行同样的操作,这给出了一个错误消息属性不受 attrControlGrp 支持。

知道如何实现吗?

解决方案就是使用 attrNavigationControlGrp 创建控件。此控件不需要虚拟父节点,将为节点连接创建 UI。