2014-09-22 57 views
0

我在Maya 2014中工作。我的自定义属性显示在Channels Box中。我现在试图在Attribute Editor中显示我的自定义属性。下面我有AECamera_OrthoTemplate.mel代码称为AETemplate文件:Maya中的属性模板

global proc AECamera_OrthoTemplate(string $nodeName) {  

    editorTemplate -beginScrollLayout ; 
    editorTemplate -beginLayout "Camera" -collapse 0 ; 
    editorTemplate -label "Always Show Frustrum" -addControl "boolAttr" ; 
    editorTemplate -label "Frustrum NearZ" -addControl "numAttr" ; 
    editorTemplate -label "Frustrum FarZ" -addControl "numAttr" ; 
    editorTemplate -label "Frustrum Width" -addControl "numAttr" ; 
    editorTemplate -label "Frustrum Height" -addControl "numAttr" ; 
    editorTemplate -endLayout ; 

    // Currently editing values on the shape object, 
    // so drag in the shape attributes as well 
    AEshapeTemplate $nodeName ; 

    editorTemplate -addExtraControls ; 
    editorTemplate -endScrollLayout ; 
} 

观看时的根据Attribute Editor与我的自定义相机形状选择我看到了开放Camera布局,里面什么都没有它,似乎都被放在Extra Attributes布局部分内部控制在底部。我想看看嵌套在Camera部分的控件。

任何帮助,让我过去这一关,将不胜感激,

感谢。

回答

2

我误解了-addControl标志,它需要属性的名称而不是要创建的控件的类型。

它在识别时自动从属性推导控制类型。

控件在额外属性部分结束的原因是由于Maya很聪明,并将任何未知属性放入此部分。

希望这对别人有帮助。

+0

事实上,你所有的发现都是正确的 - 我早些发现了这个问题,我会回答它的。你可以把自己的答案标记为“答案”。 – St0fF 2015-05-14 21:08:49