customOutliner.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:MSide 作者: jamesbdunlop 项目源码 文件源码
def __initUI(self):
        self.lyName = 'nOutlinerPaneLayout'
        self.outlinerPanelName = 'nOutlinerPanel'
        if not cmds.paneLayout(self.lyName, query = True, exists = True):
            ## Create the pane to parent the outliner to
            self.outlinerPanelLayout = cmds.paneLayout(self.lyName)
            cmds.setParent()
            self.outlinerPaneLayout_Ptr = mui.MQtUtil.findLayout(self.outlinerPanelLayout)

            ## Wrap the maya paneLayout as a QWidget
            self.outlinerPaneWidget = shiboken.wrapInstance(long(self.outlinerPaneLayout_Ptr), QWidget)
            self.outlinerPaneWidget.setObjectName('CustomOutlinerWidget')

            ## Check to see if the custom outliner panel already exists
            existPanels = [pnl for pnl in cmds.lsUI(panels = True) if self.outlinerPanelName in pnl]
            if existPanels:
                self.outlinerPanel = mui.MQtUtil.findLayout(self.outlinerPanelName)
                cmds.outlinerPanel(self.outlinerPanelName, edit = True, p = self.outlinerPanelLayout)
            else:
                self.outlinerPanel = cmds.outlinerPanel(self.outlinerPanelName,  l = self.outlinerPanelName, to = False, init = False, mbv = True, p = self.outlinerPanelLayout)

            ## Set up the defaults for the view
            self.fixEditor = cmds.outlinerEditor(self.outlinerPanelName, edit = True,
                                                 mainListConnection='worldList',
                                                 selectionConnection='modelList',
                                                 showShapes=False,
                                                 showAttributes=False,
                                                 showConnected=False,
                                                 showAnimCurvesOnly=False,
                                                 autoExpand=False,
                                                 showDagOnly=True,
                                                 ignoreDagHierarchy=False,
                                                 expandConnections=False,
                                                 showCompounds=True,
                                                 showNumericAttrsOnly=False,
                                                 highlightActive=True,
                                                 autoSelectNewObjects=False,
                                                 doNotSelectNewObjects=False,
                                                 transmitFilters=False,
                                                 showSetMembers=True,
                                                 setFilter='defaultSetFilter' )
        else:
            self.outlinerPaneLayout_Ptr = mui.MQtUtil.findLayout(self.lyName)
            self.outlinerPaneWidget = shiboken.wrapInstance(long(self.outlinerPaneLayout_Ptr), QWidget)
            self.outlinerPaneWidget.setObjectName('nOutlinerWidget')

        self.mainLayout.addWidget(self.outlinerPaneWidget, 1, 0)
        self.mainLayout.setContentsMargins(1,1,1,1)
        self.setContentsMargins(1,1,1,1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号