def __exit__(self, type, value, traceback): p = self.parent() #Ensure we set the parent back to a layout not some ui element # like say a button which does not accept children if not cmds.layout(p, exists=True): p = p.parent() #However we want to be careful not to attach to a rowGroupLayout(textFieldButtonGrp etc) # in this case set the parent to the rowGroupLayout's parent if cmds.objectTypeUI(p) == u'rowGroupLayout': p = p.parent() cmds.setParent(p) return p
def children(self): # return [ PyUI( self.name() + '|' + x) for x in self.__melcmd__(self, q=1, childArray=1) ] kids = cmds.layout(self, q=1, childArray=1) if kids: return [PyUI(self.name() + '|' + x) for x in kids] return []
def children(self): #return [ PyUI( self.name() + '|' + x) for x in self.__melcmd__(self, q=1, childArray=1) ] kids = cmds.layout(self, q=1, childArray=1) if kids: return [PyUI(self.name() + '|' + x) for x in kids] return []
def children(self): # return [ PyUI( self.name() + '|' + x) for x in self.__melcmd__(self, q=1, childArray=1) ] return [PyUI(self.name() + "|" + x) for x in cmds.layout(self, q=1, childArray=1)]