I blender 2.79 I could do:
obj.data.transform(obj.matrix_world)
sourceSurface_BVHT = BVHTree.FromObject(obj, context.scene)
This would give me BVHT of obj with modifiers, in world space. Now in 2.8 it won’t work, and I have to add additional line:
obj.data.transform(obj.matrix_world)
context.depsgraph.scene.update() #this is new line
sourceSurface_BVHT = BVHTree.FromObject(obj, context.depsgraph)
Is this normal, to have to use context.depsgraph.scene.update() for ‘data.transform’ to take effect? Maybe there is way to update depsgraph jut for this one object (for performance gain)?
After that I just to run: obj.data.transform(obj.matrix_world.inverted()) - to revert mesh transformation.
Also I noticed when running modal timer operator, If I change some custom scene property (eg. float slider), operator won’t see this property change. I have to use:
Context.depsgraph.scene.changed_property
To read the updated value. The new depsgraph makes things more complicated it seems. Is there info, when do I have to use depshgrapth evaluated props, objects, etc. and when I can skip it?