Skip to content

Commit

Permalink
Merge pull request #1098 from rasmushaugaard/main
Browse files Browse the repository at this point in the history
fix(bvh tree creation): avoid leaving orphan meshes
  • Loading branch information
cornerfarmer authored Jun 17, 2024
2 parents 464cdd0 + 801d8d6 commit 348238f
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 348238f

Please sign in to comment.