Skip to content

Commit

Permalink
fix: fixed "inside the mesh" containment test
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed May 31, 2024
1 parent 8749f2b commit 3e9d54d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/sbstudio/plugin/model/light_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def _get_bvh_tree_from_mesh(self) -> Optional[BVHTree]:
# from there
ev_mesh = cast(Mesh, obj.data)
ev_mesh.transform(mesh.matrix_world)
tree = BVHTree.FromObject(ev_mesh, depsgraph, deform=True)
tree = BVHTree.FromObject(obj, depsgraph, deform=True)
ev_mesh.transform(mesh.matrix_world.inverted())
else:
# Object is not in the evaluated depsgraph -- maybe it is
Expand All @@ -791,7 +791,7 @@ def _get_bvh_tree_from_mesh(self) -> Optional[BVHTree]:
b_mesh.from_mesh(mesh.data)
b_mesh.transform(mesh.matrix_world)
tree = BVHTree.FromBMesh(b_mesh)
return tree
return tree

def _get_plane_from_mesh(self) -> Optional[Plane]:
"""Returns a plane that is an infinite expansion of the first face of the
Expand Down
4 changes: 2 additions & 2 deletions typings/mathutils/bvhtree.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sys
from typing import Union

from bmesh.types import BMesh
from bpy.types import Depsgraph, Mesh
from bpy.types import Depsgraph, Object
from mathutils import Vector

class BVHTree:
Expand All @@ -12,7 +12,7 @@ class BVHTree:
@classmethod
def FromObject(
cls,
object: Mesh,
object: Object,
depsgraph: Depsgraph,
deform: bool = True,
render: bool = False,
Expand Down

0 comments on commit 3e9d54d

Please sign in to comment.