Skip to content

Commit

Permalink
fix(bvh tree creation): avoid leaving orphan meshes
Browse files Browse the repository at this point in the history
closes #1097
  • Loading branch information
rasmushaugaard committed May 22, 2024
1 parent 8dec616 commit 801d8d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blenderproc/python/types/MeshObjectUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ def create_bvh_tree_multi_objects(mesh_objects: List[MeshObject]) -> mathutils.b
mesh.transform(Matrix(obj.get_local2world_mat()))
# Add object mesh to bmesh
bm.from_mesh(mesh)
# Avoid leaving orphan mesh
bpy.data.meshes.remove(mesh)

# Create tree from bmesh
bvh_tree = mathutils.bvhtree.BVHTree.FromBMesh(bm)
Expand Down

0 comments on commit 801d8d6

Please sign in to comment.