[Bf-committers] Expose BM_face_calc_plane in python API

Isaac Weaver wisaac407 at gmail.com
Wed May 11 21:32:05 CEST 2016


Recently I was working on a python script where I needed to recreate the
rotation matrix that the normal transform orientation uses on faces (I
needed to take into account the rotation around the normal). After a little
digging, I found that Blender was using the function
​​
BM_face_calc_plane (found in source/blender/bmesh/intern/bmesh_polygon.c)
to calculate the vector along the negative Y axis of the plane that is
perpendicular to the normal. I created a patch[1] that exposes this to the
python API via "BMFace.calc_plane()"
​, if someone ​
could check it out that would be great!
​


As a side note, in the doc string for the
​​
BM_face_calc_plane function, it says the result isn't normalized but (I
think on line ~346) it appears to be getting normalized at the end of the
function.

[1]:https://developer.blender.org/D1988

​~ Isaac​


More information about the Bf-committers mailing list