Ejemplo n.º 1
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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo n.º 5
0
 def beginNoOptimize(self):
     cmds.editorTemplate(beginNoOptimize=True)
Ejemplo n.º 6
0
 def controlValue(cls, nodeName, control):
     return cmds.editorTemplate(queryControl=(nodeName, control))
Ejemplo n.º 7
0
 def controlLabel(cls, nodeName, control):
     return cmds.editorTemplate(queryLabel=(nodeName, control))
Ejemplo n.º 8
0
 def interruptOptimize(self):
     cmds.editorTemplate(interruptOptimize=True)
Ejemplo n.º 9
0
 def addComponents(self):
     cmds.editorTemplate(addComponents=True)
Ejemplo n.º 10
0
 def beginScrollLayout(self):
     cmds.editorTemplate(beginScrollLayout=True)
Ejemplo n.º 11
0
 def beginNoOptimize(self):
     cmds.editorTemplate(beginNoOptimize=True)
Ejemplo n.º 12
0
 def controlLabel(cls, nodeName, control):
     return cmds.editorTemplate(queryLabel=(nodeName, control))
Ejemplo 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))
Ejemplo n.º 14
0
 def endScrollLayout(self):
     cmds.editorTemplate(endScrollLayout=True)
Ejemplo n.º 15
0
 def beginScrollLayout(self):
     cmds.editorTemplate(beginScrollLayout=True)
Ejemplo n.º 16
0
 def beginLayout(self, name, collapse=True):
     cmds.editorTemplate(beginLayout=name, collapse=collapse)
Ejemplo 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))
Ejemplo n.º 18
0
 def suppress(self, control):
     cmds.editorTemplate(suppress=control)
Ejemplo n.º 19
0
 def suppress(self, control):
     cmds.editorTemplate(suppress=control)
Ejemplo n.º 20
0
 def endNoOptimize(self):
     cmds.editorTemplate(endNoOptimize=True)
Ejemplo n.º 21
0
 def beginLayout(self, name, collapse=True):
     cmds.editorTemplate(beginLayout=name, collapse=collapse)
Ejemplo n.º 22
0
 def interruptOptimize(self):
     cmds.editorTemplate(interruptOptimize=True)
Ejemplo n.º 23
0
 def endScrollLayout(self):
     cmds.editorTemplate(endScrollLayout=True)
Ejemplo n.º 24
0
 def addSeparator(self):
     cmds.editorTemplate(addSeparator=True)
Ejemplo n.º 25
0
 def endNoOptimize(self):
     cmds.editorTemplate(endNoOptimize=True)
Ejemplo n.º 26
0
 def addComponents(self):
     cmds.editorTemplate(addComponents=True)
Ejemplo n.º 27
0
 def addSeparator(self):
     cmds.editorTemplate(addSeparator=True)
Ejemplo n.º 28
0
 def addExtraControls(self, label=None):
     kwargs = {}
     if label:
         kwargs['extraControlsLabel'] = label
     cmds.editorTemplate(addExtraControls=True, **kwargs)
Ejemplo n.º 29
0
 def addExtraControls(self, label=None):
     kwargs = {}
     if label:
         kwargs['extraControlsLabel'] = label
     cmds.editorTemplate(addExtraControls=True, **kwargs)
Ejemplo n.º 30
0
 def controlValue(cls, nodeName, control):
     return cmds.editorTemplate(queryControl=(nodeName, control))