当前位置: 首页>>代码示例>>Python>>正文


Python NodeUtility.getCharactersInScene方法代码示例

本文整理汇总了Python中marigold.utility.NodeUtility.getCharactersInScene方法的典型用法代码示例。如果您正苦于以下问题:Python NodeUtility.getCharactersInScene方法的具体用法?Python NodeUtility.getCharactersInScene怎么用?Python NodeUtility.getCharactersInScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在marigold.utility.NodeUtility的用法示例。


在下文中一共展示了NodeUtility.getCharactersInScene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: updateCharacterCombo

# 需要导入模块: from marigold.utility import NodeUtility [as 别名]
# 或者: from marigold.utility.NodeUtility import getCharactersInScene [as 别名]
    def updateCharacterCombo( self ):
        '''
        Updates the character combo box so it lists all the characters in the scene.
        '''
        self.characterCombo.clear()

        self.characterNameList = []
        self.characterDict = {}
        
        for char in NodeUtility.getCharactersInScene():
            charName = cmds.getAttr( '{0}.characterName'.format( char ) )
            self.characterNameList.append( charName )
            self.characterDict[charName] = char

        if len( self.characterNameList ) == 0:
            self.characterCombo.insertItem( 0, 'No Characters' )
            self.SAVE_SELECTED_CHARACTER = None
        else:
            self.characterCombo.insertItems( 0, self.characterNameList )
            self.SAVE_SELECTED_CHARACTER = self.characterNameList[0]
开发者ID:EriLee,项目名称:marigold,代码行数:22,代码来源:UICharactersTools.py

示例2: __init__

# 需要导入模块: from marigold.utility import NodeUtility [as 别名]
# 或者: from marigold.utility.NodeUtility import getCharactersInScene [as 别名]
    def __init__( self ):
        super( UICharacterTools, self ).__init__()

        layout = QtGui.QVBoxLayout( self )

        # PRESETS
        presetsLabel = QTWidgets.basicLabel( 'Character Presets', 'bold', 14, 'white', '2B2B30', inIndent=10 )
        presetsLabel.setMinimumHeight( 30 )
        presetsLabel.setAlignment( QtCore.Qt.AlignCenter )
        
        self.scrollLayout = QtGui.QVBoxLayout()
        self.scrollLayout.setAlignment( QtCore.Qt.AlignTop )
        self.scrollLayout.setContentsMargins( 8,8,8,8 )
        self.scrollLayout.setSpacing( 4 )
        scrollArea = QTWidgets.scrollArea( self.scrollLayout )
        self.updateCards()
        
        # TOOLS
        #--Label
        toolsLabel = QTWidgets.basicLabel( 'Tools', 'bold', 14, 'white', '2B2B30', inIndent=10 )
        toolsLabel.setMinimumHeight( 30 )
        toolsLabel.setAlignment( QtCore.Qt.AlignCenter )
        
        #--Combo menu
        comboRow = QtGui.QHBoxLayout()
        comboRow.setAlignment( QtCore.Qt.AlignLeft )
        
        self.characterNameList = []
        self.characterDict = {}
        for char in NodeUtility.getCharactersInScene():
            charName = cmds.getAttr( '{0}.characterName'.format( char ) )
            self.characterNameList.append( charName )
            self.characterDict[charName] = char

        self.characterCombo = QtGui.QComboBox()
        self.updateCharacterCombo()
        self.characterCombo.setFixedWidth( 100 )
        self.characterCombo.activated.connect( self.setActiveCharacter )
        
        comboRefreshBtn = QTWidgets.imageTextButton( None, ':/riggingUI/icons/icon_refresh20.png', [16,16] )
        comboRefreshBtn.setMaximumWidth( 20 )
        comboRefreshBtn.setMaximumHeight( 20 )
        comboRefreshBtn.clicked.connect( self.updateCharacterCombo )
        
        comboRow.addWidget( self.characterCombo )
        comboRow.addWidget( comboRefreshBtn )
        
        #--Buttons
        modulePrioritiesBtn = QTWidgets.imageTextButton( 'Module Priorities', ':/riggingUI/icons/icon_match_translation.png', [16,16] )
        modulePrioritiesBtn.clicked.connect( lambda:self.characterPriorityPromptTrigger() )
        
        saveCharacterBtn = QTWidgets.imageTextButton( 'Save Character', ':/riggingUI/icons/icon_match_translation.png', [16,16] )
        saveCharacterBtn.clicked.connect( lambda:self.saveCharacter() )
        
        buildCharacterBtn = QTWidgets.imageTextButton( 'Build Character', ':/riggingUI/icons/icon_match_translation.png', [16,16] )
        buildCharacterBtn.clicked.connect( lambda:self.buildCharacter() )
        
        editModulesBtn = QTWidgets.imageTextButton( 'Edit Character Modules', ':/riggingUI/icons/icon_match_translation.png', [16,16] )
        editModulesBtn.clicked.connect( lambda:self.characterModulePromptTrigger() )
        
        #--Button grid layout.
        toolsGrid = QtGui.QGridLayout()
        toolsGrid.setColumnMinimumWidth( 0, 100 )
        toolsGrid.setColumnMinimumWidth( 1, 100 )
        toolsGrid.setColumnMinimumWidth( 2, 100 )
        toolsGrid.setSpacing( 2 )
        toolsGrid.setContentsMargins( 0,0,0,0 )
        toolsGrid.addWidget( modulePrioritiesBtn, 0, 0 )
        toolsGrid.addWidget( saveCharacterBtn, 0, 1 )
        toolsGrid.addWidget( buildCharacterBtn, 0, 2 )
        toolsGrid.addWidget( editModulesBtn, 1, 0 )
        
        
        # SETUP LAYOUT
        layout.addWidget( presetsLabel )
        layout.addWidget( scrollArea )
        layout.addWidget( toolsLabel )
        layout.addLayout( comboRow )
        layout.addLayout( toolsGrid )
开发者ID:EriLee,项目名称:marigold,代码行数:81,代码来源:UICharactersTools.py


注:本文中的marigold.utility.NodeUtility.getCharactersInScene方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。