[Bf-python] ThinMesh
Stephen Swaney
sswaney at centurytel.net
Thu May 12 05:53:00 CEST 2005
On Sun, May 08, 2005 at 02:56:04PM +1000, Campbell Barton wrote:
>
> >
> Is what your hinting at- late initialization? This has been suggested
> and is probably the best option. it also could fit seamlesly into the
> current framework.
> len(mesh.faces), len(mesh.verts), mash.mode, mesh.name ... etc. should
> be able to be accsessed without initializing the vertex/face data.
> Ot might also be worth seperating the vert/face initialization so they
> can be initialized seperately.
Lazy initialization is a strategy for postponing expensive operations.
It could be applied to the existing NMesh implementation with good
benefit.
What I am talking about is better described as a proxy for the Blender
Mesh data structure. One of the principles for building fast
applications is to never move or copy data needlessly.
Our prototypical BPy_Camera is a good example of this. It simply holds
a pointer into the existing Blender Camera struct. Other bpy types do
the same, sometimes with the possible addition of a little state data.
Now that we have more experience with python types and operators - see
the Mathutils module for example - we should be able to make a
ThinMesh module that uses blender data without copying it.
This would give a performance boost for people with a fondness for
huge meshes.
--
Stephen Swaney
sswaney at centurytel.net
More information about the Bf-python
mailing list