0
$\begingroup$

Console says i need to put the "depsgraph" parameter when checking if 2 objects overlaps, what is that? since the API manual doesn't provide options what to put in.

enter image description here

import bpy
from mathutils.bvhtree import BVHTree
for obj in bpy.context.scene.objects:
    if obj.name.startswith("myobj_"):
        for obj2 in bpy.context.scene.objects:
            if obj2.name.startswith("target_"):
                isoverlap = BVHTree.FromObject(obj).overlap(BVHTree.FromObject(obj2))
                if isoverlap is not None:
                    print("overlapping")
$\endgroup$
  • $\begingroup$ docs.blender.org/api/current/… $\endgroup$ – lemon Apr 5 at 12:41
  • $\begingroup$ i tried BVHTree.FromObject(obj, evaluated_depsgraph_get()) and BVHTree.FromObject(obj, obj.evaluated_depsgraph_get()) both not working, how is the function looks like in action? $\endgroup$ – adrian li Apr 5 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.