Example #1
0
 def wrapped(self, attr, *args, **kwargs):
     assert isinstance(attr, basestring), "%r.%s: attr argument must be a string, got %s" % (self, func.__name__, type(attr).__name__)
     modefunc = getattr(self._mode, func.__name__)
     if self.convertToMayaStyle:
         attr = toMayaStyle(attr)
     if self._record:
         self._actions.append((modefunc, (attr,) + args, kwargs))
     else:
         modefunc(attr, *args, **kwargs)
     self._attributes.append(attr)
Example #2
0
    def addAOVLayout(self, aovReorder = None):
        '''Add an aov control for each aov registered for this node type'''
        aovAttrs = aovs.getNodeGlobalAOVData(nodeType=self.nodeType())
        if aovReorder: #do some reordering based on the passed string list
            i = 0
            aovMap = {}
            for aov in aovReorder:
                aovMap[aov] = i
                i += 1
            aovAttrs = sorted(aovAttrs, key = lambda aov: aovMap[aov[0]])
        if aovAttrs:
            self.beginLayout("AOV Names", collapse=True)
#            self.beginNoOptimize()
#            self.addControl('enableAOVs', label='Enable AOVs')
#            self.addControl('overrideAOVs', label='Override AOV Names')
#            self.endNoOptimize()
            dynamic = self.nodeType() not in set(pm.pluginInfo("mtoa", q=True, dependNode=True))
            for name, attr, type in aovAttrs:
                if dynamic:
                    attr = 'ai_' + attr
                if self.convertToMayaStyle:
                    attr = toMayaStyle(attr)
                self.addAOVControl(attr)
            self.endLayout()