Page 1 of 1

Problem with NMesh.PutRaw(mesh,"name",0)

Posted: Mon Dec 09, 2002 5:55 pm
by Saade
Hello everybody

I'm trying to use Python scripts with Blender. I've been bothered by something i feel to be a bug.
When i use the Blender.NMesh.PutRaw() action with a mesh object that hold vertex color information, only part of the information is transmitted to the object. It looks to be something like a quarter of the faces.

I'm using Blender version 2.23 on a Debian Woody Linux system.

Can somebody give me a hint ??

Thanks a lot and happy Blender.

:roll:

a very simple script to give an exple of the problem

Posted: Wed Dec 11, 2002 1:19 pm
by Saade
Hello everybody.

To make my question more precise, i made a very simple script to show the problem with PutRaw and vertex painting.
To use this script, starting from the usual standard new scene of Blender, just add a UVsphere, select it and give it a Material. Then, in the Material window, activate the VCol Paint Button.

Then, in the script window, load the following script :
###########
mport Blender
from Blender import NMesh, Object

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[0]*256
f.col[f.v.index(v)].g=v.no[1]*256
f.col[f.v.index(v)].b=v.no[2]*256

NMesh.PutRaw(me,'test')
Blender.Redraw()


####################

Press Alt-P to process the script.
Entering Vertx Painting mode, one can see that only a quarter of the faces have got a color resulting from Vertex painting.

Where is the bug ????

Thanks for your help :wink:

Re: a very simple script to give an exple of the problem

Posted: Fri Dec 20, 2002 7:02 am
by jms
Saade wrote: Then, in the script window, load the following script :
###########
mport Blender
from Blender import NMesh, Object

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[0]*256
f.col[f.v.index(v)].g=v.no[1]*256
f.col[f.v.index(v)].b=v.no[2]*256

NMesh.PutRaw(me,'test')
Blender.Redraw()


####################

Press Alt-P to process the script.
Entering Vertx Painting mode, one can see that only a quarter of the faces have got a color resulting from Vertex painting.

Where is the bug ????

Thanks for your help :wink:
I know this script:
http://jmsoler.free.fr/didacticiel/blen ... ainted.htm

try to ask the question to the author on :
[url]news://news.zoo-logique.org/3D.Blender[/url]