mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
Fixed bug in tool.Blender.get_bmesh_for_mesh
It caused errors because it was expecting mesh object to be selected - when it's not necessary that active_object is the one that mesh belongs to and sometimes no objects can be selected at all.
This commit is contained in:
@@ -208,7 +208,7 @@ class Blender:
|
|||||||
def get_bmesh_for_mesh(cls, mesh, clean=False):
|
def get_bmesh_for_mesh(cls, mesh, clean=False):
|
||||||
import bmesh
|
import bmesh
|
||||||
|
|
||||||
if bpy.context.object.mode == "EDIT":
|
if mesh.is_editmode:
|
||||||
bm = bmesh.from_edit_mesh(mesh)
|
bm = bmesh.from_edit_mesh(mesh)
|
||||||
if clean:
|
if clean:
|
||||||
bm.clear()
|
bm.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user