コード例 #1
0
 def get_selected_layers( self ):
   selection = [ ]
   
   if  pmc.treeView( self.__layer_tree, q = True, si = True ) == None:
     return [ ]
   else:
     for item in pmc.treeView( self.__layer_tree, q = True, si = True ) :
       selection.append( utils.get_bake_layer( item ) )
       
   return selection
コード例 #2
0
  def button_type_change( self, layer, arg ):


    node = utils.get_bake_layer(layer)
    
    if utils.is_high( layer ):
      utils.set_low( layer )
    else:
      utils.set_high( layer )
      
    self.refresh( )
コード例 #3
0
 def __init__( self, parent, layer ):
   self.parent = parent
   self.layer = utils.get_bake_layer( layer )
   
   self.__window = pmc.window( title = 'Edit Bake Layer' )
   
   self.build( )
   
   self.refresh( )
   
   self.__window.show( )
コード例 #4
0
  def refresh_button_state( self ):
    
    bake_layers = pmc.ls( typ = 'BakeLayer' )
    
    one_selected = False
    if pmc.treeView( self.__layer_tree, q = True, si = True ) == None:
      pass 
    elif len( pmc.treeView( self.__layer_tree, q = True, si = True ) ) == 1:
      one_selected = True
      sel_layer = pmc.treeView( self.__layer_tree, q = True, si = True )[ 0 ]
    
    connected_layers = [ ]
    
    if one_selected:
      selected_is_high = utils.is_high( sel_layer )
      if selected_is_high:
        connected_layers = utils.get_connected_low_layers( sel_layer )
      else:
        connected_layers = utils.get_connected_high_layers( sel_layer )
    

    for layer in bake_layers:
      
      if one_selected == True:
        if selected_is_high == utils.is_high( layer ):
          pmc.treeView( self.__layer_tree,
                        e = True,
                        eb = ( layer, 2, False ),
                        i = ( layer, 2, '' ) )
          
          
        
        else:
          if utils.get_bake_layer( layer ) in connected_layers:
            image = bake_layer_tool.get_image( 'link_icon.png' )
          else:
            image = bake_layer_tool.get_image( 'unlink_icon.png' )
  
            
          pmc.treeView( self.__layer_tree,
                        e = True,
                        eb = ( layer, 2, True ),
                        i = ( layer, 2, image ) )
      
      else:
        pmc.treeView( self.__layer_tree,
                      e = True,
                      eb = ( layer, 2, False ),
                      i = ( layer, 2, '' ) )
コード例 #5
0
 def button_layer_editor_rename( self, old_name, new_name ):
   node = utils.get_bake_layer( old_name )
   node.rename( new_name )
   
   self.refresh( )
コード例 #6
0
 def button_quick_edit_window( self, layer, arg ):
   layer = utils.get_bake_layer( layer )
   
   quick_edit_window.EditBakeLayerWindow( self, layer )