#--------------------------------------------
# Mapping of couleur based on the normal,
# jmsoler 03 / 2002 #--------------------------------------------
import Blender
from Blender import NMesh, Object
#function of z, 0=x, 1=y
direction=2
Me=Object.GetSelected()
me=NMesh.GetRaw(Me[0].data.name)
for f in me.faces:
for v in f.v:
f.col[f.v.index(v)].r=v.no[direction]*255
f.col[f.v.index(v)].g=v.no[direction]*255
f.col[f.v.index(v)].b=v.no[direction]*255
NMesh.PutRaw(me,'test')
Blender.Redraw()
when writting code on this Forum, try putting [ c o d e ] and [ / c o d e ] tags around it.
#--------------------------------------------
# Mapping of couleur based on the normal,
# jmsoler 03 / 2002
#--------------------------------------------
import Blender
from Blender import NMesh, Object
#function of z, 0=x, 1=y
direction=2
Me=Object.GetSelected()
me=NMesh.GetRaw(Me[0].data.name)
for f in me.faces:
for v in f.v:
f.col[f.v.index(v)].r=v.no[direction]*255
f.col[f.v.index(v)].g=v.no[direction]*255
f.col[f.v.index(v)].b=v.no[direction]*255
NMesh.PutRaw(me,'test')
Blender.Redraw()
Martin
<font size=-1>[ This Message was edited by: theeth on 2002-03-25 06:13 ]</font>