def removeShaderOverride(self): """docstring for fname""" sel = mn.ls( sl = True ) rlay = rlayer.current() if not sel: rlay.removeOverridedShader() else: with undo.Undo(): for s in sel: childs = s.allchildren if childs: for c in childs: shap = c.shape if shap: mc.editRenderLayerAdjustment( shap.name + '.instObjGroups', remove = True ) shap = s.shape if shap: mc.editRenderLayerAdjustment( shap.name + '.instObjGroups', remove = True )
def applyShaderToSel( self, shader, sels ): rlay = rlayer.current() if not sels: rlay.overridedShader = shader else: for s in sels: try: sha = s.shader.a.surfaceShader.input.node sha.a.aiEnableMatte.overrided = 1 sha.a.aiEnableMatte.v = 1 sha.a.aiMatteColor.overrided = 1 if not sha.a.aiMatteColor.input: shader.a.outColor >> sha.a.aiMatteColor sha.a.aiMatteColorA.overrided = 1 sha.a.aiMatteColorA.v = 1 except: continue #sels.select() #mc.hyperShade( a = shader.name ) self.applyShaderToHair( shader, sels )
def selectLightsInLayer(self): """select lights in render layer""" lits = rlayer.current().lights if lits: lits.select()
def removeAllObjectsToLayer(self): """docstring for remove""" rlay = rlayer.current() rlay.clean()
def removeObjectToLayer(self): """docstring for removeObjectToLayer""" rlay = rlayer.current() rlay.remove( mn.ls( sl = True ) )
def addObjectToLayer(self): """docstring for addObjectToLayer""" rlay = rlayer.current() rlay.add( mn.ls( sl = True ) )