示例#1
0
 def updateTopMenu( self, inMode ):
     # Delete the existing menu bar's content.
     barChildren = cmds.menuBarLayout( self.menuBar, query=True, menuArray=True )
     if barChildren is not None:
         for child in barChildren:
             cmds.deleteUI( child )        
     
     # Now fill the menu layout with the active set.
     if inMode == 'Bits':
         self.menuEdit = cmds.menu( parent=self.menuBar, label='Edit' )
         cmds.menuItem( parent=self.menuEdit, label='Copy Bit Settings',
                        annotation='Copy one bit\'s setting to another.',
                        command=lambda b:FrameUtility.copyBitSettings() )
         cmds.menuItem( parent=self.menuEdit, label='Add Child',
                        annotation='Add child bit to another bit.',
                        command=lambda b:FrameUtility.setBitChild() )
         cmds.menuItem( parent=self.menuEdit, label='Delete Child',
                        annotation='Remove child bit from selected bit.',
                        command=lambda b:FrameUtility.deleteBitChild() )
         
     elif inMode == 'Component':
         self.menuJoints = cmds.menu( parent=self.menuBar, label='Joints' )
         cmds.menuItem( parent=self.menuJoints, label='Joint', annotation='Creates a node of type jointComponentNode',
                        command=lambda b, a1='jointComponentNode':self.addComponentToObject(a1) )
         
         self.menuControls = cmds.menu( parent=self.menuBar, label='Controls' )
         cmds.menuItem( parent=self.menuControls, label='TEMP', annotation='TEMP' )
         
         self.menuDeformers = cmds.menu( parent=self.menuBar, label='Deformers' )
         cmds.menuItem( parent=self.menuDeformers, label='TEMP', annotation='TEMP' )
         
         self.menuConstraints = cmds.menu( parent=self.menuBar, label='Constraints' )
         cmds.menuItem( parent=self.menuConstraints, label='TEMP', annotation='TEMP' )
         
     elif inMode == 'Module':
         self.menuFile = cmds.menu( parent=self.menuBar, label='File' )
         cmds.menuItem( parent=self.menuFile, label='Save Module XML',
                        annotation='Save the selected frame module to XML.',
                        command=lambda b:FrameUtility.createFrameModuleXML() )
         
     elif inMode == 'Character':
         self.menuEdit = cmds.menu( parent=self.menuBar, label='Character Item' )
         cmds.menuItem( parent=self.menuEdit, label='TEMP', annotation='TEMP' )