This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from mathutils.bvhtree import BVHTree | |
C = bpy.context | |
# Build BVH once | |
bvh = BVHTree.FromObject(C.object, C.evaluated_depsgraph_get()) | |
for i in range(999999): | |
# Slower, this possibly builds BVH everytime |