[Bf-python] Project suggestions (thinmesh maybe?)

Stephen Swaney sswaney at centurytel.net
Sat Sep 17 18:41:40 CEST 2005


On Fri, Sep 16, 2005 at 01:18:32PM -0700, Ken Hughes wrote:

> I'm looking for another project to work on while the previous patches 
> are reviewed.  One thing which has come up again recently in this list 
> is the NMesh module.  I looked back through the ML archives and only 
> found a brief discussion of the "thin mesh" idea from May 2005.  

The existing NMesh module is a chunk of legacy code from before the
api2_2x rewrite.  IIRC, NMesh was a reworking of the even-earlier Mesh
module.  Blender Python has gone thru a couple of major versions!

One of our design principles for the current iteration of BPy is that
our BPy types are thin wrappers around existing Blender data.  You can
think of them as Adaptor classes if you want to use Design Pattern
terms.  As thin wrappers, BPy types do not make or hold copies of
Blender data, but simply provide an interface to the data.  This is
where the current NMesh falls down.

Copying data causes major performance problems when creating a new
NMesh from an existing Mesh.  Holding data creates the usual problems
associated with having multiple copies of something lying around.
Another performance hit comes when NMesh data needs to be flushed back
to Blender.

Ideally, a ThinMesh implementation would operate directly on the
underlying Blender Mesh data without making copies.  It would only
hold references to the Blender data and whatever internal members it
needs to maintain state.

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list