[Bf-python] Changing BPy Mesh to use more editMesh code

Campbell Barton cbarton at metavr.com
Thu Jul 20 03:12:42 CEST 2006


I see where your coming from, IMHO use of editMesh should be avoided for 
speed reasons (converting all data to and from), and only used if 
removing data keeps on causing problems- a certain amount of errors can 
be expected since the Mesh module is new.

If we do end up having to use editmode it would be good to have some way 
to queue functions so editmesh wasnt cycled many times unnecessarily

- Cam

Ken Hughes wrote:
> Long story short: Cam found some bugs in the edge and face delete code 
> of the Mesh API, and when Ton looked at the code he wasn't happy with 
> the duplication.  He wants Mesh to use the editMesh code for 
> manipulation of meshes.  The biggest hinderances to using the existing 
> code, though, are
> (1) the global G struct
> (2) whether the whole Mesh module should be rewritten to work using 
> the editMesh structure or just parts of it
> (3) the inability to edit more than one mesh at a time
>
> Joe Eagar is planning to remove the G "globalness" from the editMesh 
> code, which will definitely take care of (1).  (2) is a different 
> issue, mainly a trade-off: either we copy the mesh to an editMesh when 
> we want to use those functions and copy the resulting mesh back when 
> they're done, or we need to have an .update() method to flush the 
> editMesh changes to the mesh structure.  I can't think of a way to do 
> this automagically.  Right now, the Mesh module does do the copy-back- 
> and-forth for the tool methods like me.quadToTriangle(), and .delete() 
> and .extend() can probably do that as well.  I've spend the morning 
> looking at me.edges.delete() and it was not too hard to convert.
>
> (3) is only an issue if we decide to implement (2), and Joe's changes 
> will probably make it possible anyway.
>
> One side effect of using editMode code will be changes in the behavior 
> of some existing methods.  me.edges.delete() for example, will change 
> the selection state of edges (and probably verts and faces) since this 
> is what editMode does.  In fact, me.edges.delete() will basically do 
> nothing more than set the SELECT bit of each face in the input 
> sequence and clear all the others.  As such, hopefully we can do this 
> when we break the rest of the API anyway.
>
> Ken
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241



More information about the Bf-python mailing list