在outliner Editor Maya中显示自定义节点

时间:2018-03-22 19:12:32

标签: python pyside maya pymel

是否可以在clone outliner编辑器中显示自定义节点? 我想显示自定义组和子网格,从方法返回到新的大纲窗口。

我想创建这个经理,4列是大纲

This is manager

布局中的四列大纲:

      cmd.paneLayout('d', configuration='vertical4',  h=WS.h )
    cmd.formLayout('form_parts' )
        m = cmd.itemFilter( bs=partGroups() )
        editor = cmd.outlinerEditor( mainListConnection='worldList', selectionConnection='modelList',)
        outliner = cmd.outlinerEditor(editor, edit=True)
        cmd.setParent('..')
        cmd.formLayout('form_parts', edit=True, attachForm=[ (outliner, 'top', 0), (outliner, 'left', 0), (outliner, 'right', 0), (outliner, 'bottom', 0) ] )

cmd.formLayout('form_parts2')
    f = cmd.itemFilter(byType="transform")
    editor2 = cmd.outlinerEditor( mainListConnection='worldList', selectionConnection='modelList', filter = f )
    outliner2 = cmd.outlinerEditor(editor2, edit=True)
    cmd.setParent('..')
    cmd.formLayout('form_parts2', edit=True, attachForm=[ (outliner2, 'top', 0), (outliner2, 'left', 0), (outliner2, 'right', 0), (outliner2, 'bottom', 0) ] )

cmd.formLayout('form_parts3' )
    editor2 = cmd.outlinerEditor( mainListConnection='worldList', selectionConnection='modelList', f = "DefaultContainerFilter")
    outliner2 = cmd.outlinerEditor(editor2, edit=True)
    cmd.setParent('..')
    cmd.formLayout('form_parts3', edit=True, attachForm=[ (outliner2, 'top', 0), (outliner2, 'left', 0), (outliner2, 'right', 0), (outliner2, 'bottom', 0) ] )

cmd.formLayout('form_parts4' )
    editor3 = cmd.outlinerEditor( mainListConnection='worldList', selectionConnection='modelList', f = "DefaultContainerFilter" )
    outliner3 = cmd.outlinerEditor(editor3, edit=True)
    cmd.setParent('..')
    cmd.formLayout('form_parts4', edit=True, attachForm=[ (outliner3, 'top', 0), (outliner3, 'left', 0), (outliner3, 'right', 0), (outliner3, 'bottom', 0) ] )

我的问题是,或者只能是我需要的内容。 例如:

  • 第一列仅网格
  • 仅第二列分组和网格树
  • 三个专栏组
  • 四列特殊组在方法中定义并返回 含量

如果无法做到这一点,我可能不得不把它写成pyside

谢谢

1 个答案:

答案 0 :(得分:0)

您应该使用过滤器和setFilter ..请检查此https://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/CommandsPython/outlinerEditor.html#flagsetFilter

例如

filterList = cmds.listNodeTypes("light")
cmds.outlinerEditor(myOutliner, edit=True, filter=filterMode, setFilter=filterMode, dag=False)