本文整理汇总了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]
示例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 )