System Information
Operating system: Win10
Graphics card: EVGA GTX970
Blender Version
Broken: BVHTree calculation
2.80, 9dde3e42a7c5, blender2.8, 2018-12-20
Short description of error
Scripting in Blender python, running a script that calculates BVHTree twice (for example, clicking RUN SCRIPT twice) on the same object causes crash.
Exact steps for others to reproduce the error
Put two cubes in a new file. Rename "s" and "t".
Open a new text editor and run the below code.
First time it runs fine. Run again and it will crash.
Reopen blender.
Run object "s". Runs OK.
Change code to run object "t". Runs OK.
Run either object again and it will crash.
I tried in 2.79 and it works ok (modifying for depsgraph of course).
import bpy
from mathutils.bvhtree import BVHTree
s = 's'
t = 't'
sc = bpy.context.depsgraph
bvhtree = BVHTree.FromObject(bpy.data.objects[s], sc)