I’d like to align a plane to the current view with bmesh.
I can successfully do it without bmesh if I create the plane with
bpy.ops.mesh.primitive_plane_add and use the view matrix transposed to Euler to orient it:
However, this is not the case if I create it with bmesh and use the view_matrix as is:
obj=bpy.context.object bm = bmesh.from_edit_mesh(obj.data) viewMat=bpy.context.region_data.view_matrix bmesh.ops.create_grid(bm, x_segments=3, y_segments=3, size=2, matrix=viewMat)
How can I convert the view matrix so that bmesh can use it to rotate the plane as expected?
In my case I don’t care about the position, whether it’s at 0 or somewhere else. I just need the rotation to be aligned.