Blender 2.8: Snap System: Replace DerivedMesh with Mesh
Changes PlannedPublic

Authored by Germano Cavalcante (mano-wii) on Oct 23 2017, 9:38 PM.

Details

Summary

DerivedMesh will be removed in Blender 2.8. So I'm just getting ahead.

One disadvantage of using Mesh is that the struct does not have the BVHCache * bvhCache member.
In DerivedMesh, the bvhtree is stored until the object is modified.

Without this cache, bvhtree is created every time the snap context starts (transform operator, scene.raycast ...). The function becomes less efficient.

  • Remembering that the boundbox is tested before creating the bvhtree.

However, it is somewhat advantageous to clear memory.

So, add or not the BVHCache * bvhCache member to the struct Mesh ?

Diff Detail

Could we postpone this patch for now?

We will need a general way to handle BVH-tree cache for many other places, I'd rather handle this once we remove derived-meshes.

Germano Cavalcante (mano-wii) planned changes to this revision.Dec 6 2017, 5:09 PM