[Bf-python] Remaining Mesh Bugs

Campbell Barton cbarton at metavr.com
Sat Jun 30 09:27:29 CEST 2007


Iv been looking for holes in the python API, and places where a script 
could crash blender by referecing invalid data.

I think most of these are fixed in the Py dev trunk, however there are 3 
remaining.

* MEdge_setV1/2 - This can crash blender because all faces need edges.
*  2 edges using the same verts are not checked for.
Solution is to remove search and see if this edge is in a face, if so- 
add a duplicate.

edge.v1 = somevert

* MFace_setVerts - same as above, the MFace needs valid edges.
* 2 faces are not checked for, but that wont crash blender.

Solution is to check doubles add edges on all sides of the face.
face.v = (v1,v2,v3,v4)

Iv checked and these do crash when miss used.


For the pydev branch Iv removed these because there not really needed. 
but would be nice to fix for 2.44 stable.


Last one is not so simple.
mesh.getFromObject(ob) - re-assigns the mesh pointer which is 
problematic if there are more then one PyObject of the same mesh...


This will/should crash for example

________________________________
me1 = Mesh.Get('Cube')
me2 = Mesh.Get('Cube')

me1.getFromObject(someOb)

# me2 now points to a free'd mesh
for v in me2.print v.co
________________________________


would appretiate help fixing these - all are in 2.44 stable.



More information about the Bf-python mailing list