parameters: (self, plug)
docstring: Called to create the UI objects when a new node type is edited.
docstring_summary: Called to create the UI objects when a new node type is edited.
docstring_tokens: Called to create the UI objects when a new node type is edited .
function: def attributeBuild(self, plug):
          """Called to create the UI objects when a new node type is edited."""
          node, attrName = plug.split('.')
          # Check if attribute exists.
          exists = attrName in cmds.listAttr(node)
  
          if not exists:
              # Hide the layout. It's not created yet, but Maya created a parent
              # and its height is about 1 pixel. We don't need an extra space.
              self.setVisible(False)
          else:
              group = attrName + "Grp"
              button = attrName + "Btn"
              layout = attrName + "Layout"
  
              # Create the layout
              cmds.rowLayout(
                  layout,
                  columnWidth2=(BUTTON_POSITION - 5, BUTTON_SIZE),
                  numberOfColumns=2)
  
              # Form the nice name.
              attr = next(a for a in ATTRIBUTES if a['name'] == attrName)
              label = attr['label']
  
              control = self.getControllerGroup(plug)
              control(group, attribute=plug, label=label)
  
              cmds.button(
                  button,
                  label="-",
                  width=BUTTON_SIZE,
                  height=BUTTON_SIZE)
  
              cmds.setParent("..")
  
              self.attributeReplace(plug)
function_tokens: def attributeBuild ( self , plug ) : node , attrName = plug . split ( '.' ) # Check if attribute exists. exists = attrName in cmds . listAttr ( node ) if not exists : # Hide the layout. It's not created yet, but Maya created a parent # and its height is about 1 pixel. We don't need an extra space. self . setVisible ( False ) else : group = attrName + "Grp" button = attrName + "Btn" layout = attrName + "Layout" # Create the layout cmds . rowLayout ( layout , columnWidth2 = ( BUTTON_POSITION - 5 , BUTTON_SIZE ) , numberOfColumns = 2 ) # Form the nice name. attr = next ( a for a in ATTRIBUTES if a [ 'name' ] == attrName ) label = attr [ 'label' ] control = self . getControllerGroup ( plug ) control ( group , attribute = plug , label = label ) cmds . button ( button , label = "-" , width = BUTTON_SIZE , height = BUTTON_SIZE ) cmds . setParent ( ".." ) self . attributeReplace ( plug )