[Bf-python] povanim

Willian Padovani Germano wgermano at ig.com.br
Sun Jul 6 06:25:24 CEST 2003


Hi,

> Not sure that  I understand the problem of the two arrays.

No problem, it's another internal 'Blenderism', one of those things that'll
probably change when the Blender kernel gets a rewrite.

> > There's one thing you can do: on each material of your model, turn the
> > "VCol Paint" button "on".  Then in Python check the material:
> >
> > me = NMesh.GetRaw("my_mesh")
> > mat = me.materials[0]
> > if mat: has_vcols = mat.mode & mat.Modes['VColPaint']
> >
> > If has_vcols isn't zero, then you can use the me.faces.col as vertex
> > colors.
> >
>
> Yes, but in this case, how are you really sure that vcolors, or fcolors,
> are used?

Tell your users about it: to export vertex colors when you also have
uv-textures, turn on the "VCol Paint" button in Material window for all
relevant materials (all materials behind some vertex painting).

> In B2.27 the hasVertexColours() function gives a security and
> the infos was consistent with  the real contents of the mesh.

It's still available, unless there's some bug there now (actually I fixed a
few bugs there, hopefully).  If so, please tell us.

> Povanim tests yet this mode as you show me,  but checks also
> the  real contents of the mesh to avoid an fatal error during the
> exportation. Actually, as you are implementing all this, there is
> a possible error if user pushes vcolpaint button without vcol/fcol in
> the mesh.

I'll investigate this possibility.  It would affect Blender, too, if that
was an error.  I made a quick test now and what Blender does is make the
vertices all white, so no error.

> At least add a hasFaceColours() function in the mesh ...and a
> button FacCol to delete them in the Edit Buttons Windows.

What do you mean by FaceColours?  Textures?  If so, just check if some face
has an image.  If you really mean face colors (a single color applied to
each face), then it's about the Material rgb color.  The faces hold indices
to them, as you know.  But in Blender when you push "VCol Paint", the
material colors are passed to the vertex colors.  That's why there's only
faces.col in Python.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list