def joint(*args, **kwargs): """ Maya Bug Fix: - when queried, limitSwitch*, stiffness*, and angle* flags returned lists, each with one value, instead of single values. Values are now properly unpacked """ res = cmds.joint(*args, **kwargs) #if kwargs.pop('query',False) or kwargs.pop('q',False): if kwargs.get('query', kwargs.get( 'q', False)): args = [ 'limitSwitchX', 'lsx', 'limitSwitchY', 'lsy', 'limitSwitchZ', 'lsz', 'stiffnessX', 'stx', 'stiffnessY', 'sty', 'stiffnessZ', 'stz', 'angleX', 'ax', 'angleY', 'ay', 'angleZ', 'az' ] if filter( lambda x: x in args, kwargs.keys()): res = res[0] else: try: res = cmds.ls(sl=1)[0] except: pass return res
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__])