[Bf-python] BMesh python api proposal.

Campbell Barton ideasman42 at gmail.com
Fri Feb 24 14:27:47 CET 2012


Follow up on this topic, heres the initial bmesh / python api.

The API still needs further testing and sorely in need of script
examples for the docs but I think this is getting close to usable.

http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.html
http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.types.html
http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.utils.html

Notes
=====
* use 'bmesh' as module name (not bme).

* using vertex/edge/face.select_set(True/False), didn't see any better
alternatives and explain in docs the difference, I think this is OK.

* data access and queries are direcly access from the BMesh/BMVert/...
classes. so you can do vert.co, edge.calc_face_angle(). but _not_
destructive mesh editing.

* All mesh editing functions are accessed from `bmesh.utils` this is
split into own module for 2 reasons
** to make it clear the distinction betweem editing and data access.
(which is good to do IMHO)
** some of the operations dont work as class methods - for eg -
joining a list of faces.


Still Todo
==========

* Access BMesh walkers
* Access selection history
* Access BMesh Operators
* Better conversions from/to BMesh, so you can modify a mesh which
isnt in editmode.
* a way to re-tesselate the current editmesh after changes.



More information about the Bf-python mailing list