Blender 2.8: Snap System: Replace DerivedMesh with Mesh

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



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

rB Blender

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
This revision was not accepted when it landed; it landed in state Changes Planned.May 9 2018, 1:04 AM
This revision was automatically updated to reflect the committed changes.