[Bf-python] povanim

jms jmsoler at free.fr
Sun Jul 6 00:40:30 CEST 2003


Willian Padovani Germano wrote:

> ...

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

In B2.27, If I tryed to access to an empty array of vcol or fcol
there was an error and the exportation was stopped.

> 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?

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

> Only thing is that I didn't implement the mat.Modes dict yet (duh!).
> The next version will have it, sorry.
>
> If this solution doesn't prove good enough, tell us, please.
>

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.

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

With Regards.





More information about the Bf-python mailing list