def addControl(self,
                control,
                label=None,
                changeCommand=None,
                annotation=None,
                preventOverride=False,
                dynamic=False):
     args = [control]
     kwargs = {'preventOverride': preventOverride}
     if dynamic:
         kwargs['addDynamicControl'] = True
     else:
         kwargs['addControl'] = True
     if changeCommand:
         if hasattr(changeCommand, '__call__'):
             import pymel.tools.py2mel
             name = self.__class__.__name__ + '_callCustom_changeCommand_' + control
             changeCommand = pymel.tools.py2mel.py2melProc(
                 changeCommand, procName=name, argTypes=['string'])
         args.append(changeCommand)
     if label:
         kwargs['label'] = label
     if annotation:
         kwargs['annotation'] = annotation
     cmds.editorTemplate(*args, **kwargs)
Esempio n. 2
0
 def callCustom(self, newFunc, replaceFunc, *attrs):
     #cmds.editorTemplate(callCustom=( (newFunc, replaceFunc) + attrs))
     import pymel.tools.py2mel
     if hasattr(newFunc, '__call__'):
         name = self.__class__.__name__ + '_callCustom_newFunc_' + '_'.join(attrs)
         newFunc = pymel.tools.py2mel.py2melProc(newFunc, procName=name, argTypes=['string'] * len(attrs))
     if hasattr(replaceFunc, '__call__'):
         name = self.__class__.__name__ + '_callCustom_replaceFunc_' + '_'.join(attrs)
         replaceFunc = pymel.tools.py2mel.py2melProc(replaceFunc, procName=name, argTypes=['string'] * len(attrs))
     args = (newFunc, replaceFunc) + attrs
     cmds.editorTemplate(callCustom=1, *args)
Esempio n. 3
0
 def callCustom(self, newFunc, replaceFunc, *attrs):
     #cmds.editorTemplate(callCustom=( (newFunc, replaceFunc) + attrs))
     import pymel.tools.py2mel
     if hasattr(newFunc, '__call__'):
         name = self.__class__.__name__ + '_callCustom_newFunc_' + '_'.join(attrs)
         newFunc = pymel.tools.py2mel.py2melProc(newFunc, procName=name, argTypes=['string'] * len(attrs))
     if hasattr(replaceFunc, '__call__'):
         name = self.__class__.__name__ + '_callCustom_replaceFunc_' + '_'.join(attrs)
         replaceFunc = pymel.tools.py2mel.py2melProc(replaceFunc, procName=name, argTypes=['string'] * len(attrs))
     args = (newFunc, replaceFunc) + attrs
     cmds.editorTemplate(callCustom=1, *args)
Esempio n. 4
0
 def addControl(self, control, label=None, changeCommand=None, annotation=None, preventOverride=False, dynamic=False):
     args = [control]
     kwargs = {'preventOverride': preventOverride}
     if dynamic:
         kwargs['addDynamicControl'] = True
     else:
         kwargs['addControl'] = True
     if changeCommand:
         if hasattr(changeCommand, '__call__'):
             import pymel.tools.py2mel
             name = self.__class__.__name__ + '_callCustom_changeCommand_' + control
             changeCommand = pymel.tools.py2mel.py2melProc(changeCommand, procName=name, argTypes=['string'])
         args.append(changeCommand)
     if label:
         kwargs['label'] = label
     if annotation:
         kwargs['annotation'] = annotation
     cmds.editorTemplate(*args, **kwargs)
 def beginNoOptimize(self):
     cmds.editorTemplate(beginNoOptimize=True)
 def controlValue(cls, nodeName, control):
     return cmds.editorTemplate(queryControl=(nodeName, control))
Esempio n. 7
0
 def controlLabel(cls, nodeName, control):
     return cmds.editorTemplate(queryLabel=(nodeName, control))
Esempio n. 8
0
 def interruptOptimize(self):
     cmds.editorTemplate(interruptOptimize=True)
Esempio n. 9
0
 def addComponents(self):
     cmds.editorTemplate(addComponents=True)
Esempio n. 10
0
 def beginScrollLayout(self):
     cmds.editorTemplate(beginScrollLayout=True)
Esempio n. 11
0
 def beginNoOptimize(self):
     cmds.editorTemplate(beginNoOptimize=True)
Esempio n. 12
0
 def controlLabel(cls, nodeName, control):
     return cmds.editorTemplate(queryLabel=(nodeName, control))
Esempio n. 13
0
 def dimControl(self, nodeName, control, state):
     #nodeName = nodeName if nodeName else self.nodeName
     # print "dim", nodeName
     cmds.editorTemplate(dimControl=(nodeName, control, state))
Esempio n. 14
0
 def endScrollLayout(self):
     cmds.editorTemplate(endScrollLayout=True)
Esempio n. 15
0
 def beginScrollLayout(self):
     cmds.editorTemplate(beginScrollLayout=True)
Esempio n. 16
0
 def beginLayout(self, name, collapse=True):
     cmds.editorTemplate(beginLayout=name, collapse=collapse)
Esempio n. 17
0
 def dimControl(self, nodeName, control, state):
     #nodeName = nodeName if nodeName else self.nodeName
     #print "dim", nodeName
     cmds.editorTemplate(dimControl=(nodeName, control, state))
Esempio n. 18
0
 def suppress(self, control):
     cmds.editorTemplate(suppress=control)
Esempio n. 19
0
 def suppress(self, control):
     cmds.editorTemplate(suppress=control)
Esempio n. 20
0
 def endNoOptimize(self):
     cmds.editorTemplate(endNoOptimize=True)
Esempio n. 21
0
 def beginLayout(self, name, collapse=True):
     cmds.editorTemplate(beginLayout=name, collapse=collapse)
Esempio n. 22
0
 def interruptOptimize(self):
     cmds.editorTemplate(interruptOptimize=True)
Esempio n. 23
0
 def endScrollLayout(self):
     cmds.editorTemplate(endScrollLayout=True)
Esempio n. 24
0
 def addSeparator(self):
     cmds.editorTemplate(addSeparator=True)
Esempio n. 25
0
 def endNoOptimize(self):
     cmds.editorTemplate(endNoOptimize=True)
Esempio n. 26
0
 def addComponents(self):
     cmds.editorTemplate(addComponents=True)
Esempio n. 27
0
 def addSeparator(self):
     cmds.editorTemplate(addSeparator=True)
Esempio n. 28
0
 def addExtraControls(self, label=None):
     kwargs = {}
     if label:
         kwargs['extraControlsLabel'] = label
     cmds.editorTemplate(addExtraControls=True, **kwargs)
Esempio n. 29
0
 def addExtraControls(self, label=None):
     kwargs = {}
     if label:
         kwargs['extraControlsLabel'] = label
     cmds.editorTemplate(addExtraControls=True, **kwargs)
Esempio n. 30
0
 def controlValue(cls, nodeName, control):
     return cmds.editorTemplate(queryControl=(nodeName, control))