rendered paste body#!/usr/bin/env python# Jotain nodeimport Blenderimport Blender.Nodeimport Blender.Mathutils as muimport mathclass Jotain(Blender.Node.node): def __init__(self, indef, outdef): self.printed = 0 strength=[Blender.Node.VALUE, 0.08, 1.0, 1.0, 1.0, 0.0, 100.0] clr=[Blender.Node.RGBA, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0] color= ['color'] color.extend(clr) indef.definitions = [color] outdef.definitions = [color] def __call__(self): """ the exec func """ texcoord = self.shi.texture #print texcoord colr= self.ins['color'] col= colr colvec= mu.Vector(colr) col= (1.0, 1.0, 1.0, 0.0) shicolvec= mu.Vector(self.shi.color) nVec = mu.Vector(1.0, 1.0, 1.0, 0.0) shicollen= shicolvec.length / nVec.length collen= colvec.length / nVec.length colnormorig= collen / shicollen if colnormorig<0.2: colnorm= 0.0 #elif colnormorig<0.3: # colnorm= 0.15 #elif colnormorig<0.4: # colnorm= 0.4 elif colnormorig<0.5: colnorm= 0.5 elif colnormorig<0.6: colnorm= 0.6 elif colnormorig<0.7: colnorm= 0.7 #elif colnormorig<0.8: # colnorm= 0.8 #elif colnormorig<0.9: # colnorm= 0.9 else: colnorm= 1.0 newcol= (col[0] * colnorm, col[1] * colnorm, col[2] * colnorm, 0.0) self.outs['color'] = newcol