[Bf-python] Thinmesh module

Ken Hughes khughes at pacific.edu
Mon Sep 19 02:53:01 CEST 2005


Campbell Barton wrote:

> I have written a few mesh editing scripts - 
> http://members.iinet.net.au/~cpbarton/ideasman/
> good to here your serious about ThinMesh. Here are some random comments.
> 
>    * Will you use EditMesh or Mesh structure? the 1 shortcoming with
>      using editmesh is that you cant modify texFaces in edit mode (not
>      sure if that applies to a python wrapper)

First thought is to use the Mesh structure, although from what digging 
I've done in the mesh code chasing various bugs there might be some 
speed advantages to having the mesh data preprocessed (hash tables for 
locating edges, etc).

>      - In the case where you dont use editMesh you are stuck with C
>      arrays, you're probably aware of how applications handle allocating
>      chunks of memory for arrays to grow in size.
>      It might be worth looking at how Jiri implimented Verse in
>      blender, he did some tricky memory management stuff for that.

Doing this efficiently (from speed and memory standpoints) certainly 
requires thought.  I've got some ideas but would like input from other 
developers and users as to what would be useful and correct.  Luckily, 
as I plan to follow Willian's suggestion and leave that implementation 
for later on, there's time for everyone to have input.  (As I said on 
IRC this morning, I'm happy to be just the thinmesh codemonkey.)

>    * Some python/Mesh script only modify UV coords, vertex colours,
>      vertex locations. It would be good if the wrapper was designed so
>      a lot of memory allocating was not needed for just modifying data.
>      (as is the case now)

I think the wrapper approach would do just this.  The examples of 
wrappers for Camera, Lamp, Curve, etc., are basically just an object 
with a pointer to the Blender data, plus these objects are only created 
when accessed.  If a user doesn't access the edge data, nothing is 
allocated.

>    * On the flipside, editMesh might make accsess to mesh tools like
>      scanFill, beauty fill, duplicate. Ip personaly rather faster
>      modification of existing data but there is definetly advantages
>      with EditMesh data/mode.

I'm not a mesh modeler so don't know how desirable those would be from 
Python...

>    * Zr has made edges exist for all mesh objects, is this design
>      decission somthing that will carry onto python?

I would say so; again, I'm not a mesh modeler but I would think that 
whatever type of mesh data is created using the Python API should be 
consistent with what can be created using the UI.  Others can certainly 
give wiser advice here.

Ken



More information about the Bf-python mailing list