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

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Saade
Posts: 4
Joined: Mon Dec 09, 2002 5:45 pm

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

Postby Saade » Mon Dec 09, 2002 5:55 pm

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:

Saade
Posts: 4
Joined: Mon Dec 09, 2002 5:45 pm

a very simple script to give an exple of the problem

Postby Saade » Wed Dec 11, 2002 1:19 pm

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:

jms
Posts: 327
Joined: Sat Oct 19, 2002 3:04 pm

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

Postby jms » Fri Dec 20, 2002 7:02 am

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/blender/tutor/cpl_NormalPainted.htm

try to ask the question to the author on :
news://news.zoo-logique.org/3D.Blender
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.


Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest