def __init__(self, name=None, force=False): if name and cmds.uiTemplate(name, exists=True): if force: cmds.deleteUI(name, uiTemplate=True) else: self._name = name return args = [name] if name else [] self._name = cmds.uiTemplate(*args)
def reload(cls): "Reload the template. Beware, this reloads the module in which the template exists!" nodeType = cls.nodeType() form = "AttrEd" + nodeType + "FormLayout" exists = cmds.control(form, exists=1) and cmds.formLayout(form, q=1, ca=1) if exists: sel = cmds.ls(sl=1) cmds.select(cl=True) cmds.deleteUI(form) if sel: cmds.select(sel) reload(sys.modules[cls.__module__])
def reload(cls): nodeType = cls.nodeType() form = "AttrEd" + nodeType + "FormLayout" exists = cmds.control(form, exists=1) and cmds.formLayout(form, q=1, ca=1) if exists: sel = cmds.ls(sl=1) cmds.select(cl=True) cmds.deleteUI(form) aeScript = "AE" + nodeType + "Template.mel" _mm.eval('source "' + aeScript + '"') if exists: cmds.select(sel) reload(sys.modules[cls.__module__])
def clear(self): """ Clear all menu items from this OptionMenu """ for t in self.getItemListLong() or []: cmds.deleteUI(t)
def delete(self): cmds.deleteUI(self, window=True)
def clear(self): children = self.getChildArray() if children: for child in self.getChildArray(): cmds.deleteUI(child)