[Bf-python] NMesh and Vert Colors

Jordi Rovira i Bonet jordi.rovira at ima.udg.es
Thu May 29 11:13:16 CEST 2003


Peter Amstutz wrote:

>Yes, not to mention that any sane 3D file format stores polygons as lists
>of indices rather than lists of vertex positions, so exporting polygons
>from the Blender API requires some rather creative coding!  I particularly
>like the O(n^2) algorithm of doing a linear search through the main vertex
>list for each polygon vertex to find a vertex that matches, and then using
>that index for your output...
>
Agreed, but for edition of models (not for visualization) it's better 
the blender way to store meshes. I suppose many of us have implemented a 
"sorting" of vertices looking for the ones which share textures and 
colors to optimize meshes for exporting to visualization formats. I have 
this implemented in a  python script (quadratic time, obvioulsy). That's 
why i think that this conversion could be added at python level in a 
"utility toolkit of common operations in blender python scripts". If we 
think a little bit about it, we'll find many functions that could fit in 
there.

(bandoler)




More information about the Bf-python mailing list