VertexPaint [EDITED]


(klopes) #1

I try to colour a mesh with red, and i make this… please, read the code, it’s important!


for f in faces_in_mesh:
	for c in range(4):
		color=NMesh.Col(255,0,0,255)
		f.col[c]=color
NMesh.PutRaw(me)  

It returns only some faces painted, wath’s wrong??? Thanks all
__MORE
I noticed: this code makes the above explained, only in 2.25. It crashes my 2.23!


(RipSting) #2

Try this:

for f in faces_in_mesh: 
   for c in range(4): 
      f.col[c]=NMesh.Col(255,0,0,255) 
NMesh.PutRaw(me)  

(klopes) #3

Thanks, but it makes the same. I’ve discovered that it runs only if original mesh has… TexFace button actived! :-? Maybe an API bug?


(eeshlo) #4

This is a known bug, when creating vertex colours, you have to specify uv-coordinates as well:


for f in faces_in_mesh:
   for c in range(4):
      color = NMesh.Col(255,0,0,255)
      f.col[c] = color
      f.uv = [(0.0, 1.0), (0.0, 0.0), (1.0, 0.0), (1.0, 1.0)]
NMesh.PutRaw(me)


(klopes) #5

It’s a relief, thanks once more…