def applyShaderToHair(self,shader, sels): """docstring for applyShaderToHair""" hairSel = [] if sels: for s in sels: hai = mn.listRelatives( s.name, type = 'hairSystem', ad = True ) if hai: hairSel.extend( hai ) try: hai = mn.listRelatives( s.name, type = 'shaveHair', ad = True ) if hai: hairSel.extend( hai ) except: pass else: hairSel = mn.ls( typ = 'hairSystem' ) try: hairSel.extend( mn.ls( typ = 'shaveHair' ) ) except: pass if not hairSel: return for h in hairSel: h.a.aiHairShader.overrided = True try: shader.a.outColor >> h.a.aiHairShader except: continue
def correctNameForCtlCurves(): #rename ctl for n in mn.ls( '*_ctl' ): child = mn.listRelatives( n.name, s = True, ni = True, f = True ) print child if child: print n.name, child[0].name, n.name + 'Shape' child[0].name = n.name + 'Shape' print n.name,child