tornavis/source/blender/editors/geometry
Joseph Eagar d7cfb6ac71 Sculpt: Opaque vertex type for sculpt
This is a port of sculpt-dev's `SculptVertRef` refactor
(note that `SculptVertRef was renamed to PBVHVertRef`)
to master. `PBVHVertRef` is a structure that abstracts
the concept of a vertex in the sculpt code; it's simply
an `intptr_t` wrapped in a struct.

For `PBVH_FACES` and `PBVH_GRIDS` this struct stores a
vertex index, but for `BMesh` it stores a direct pointer
to a BMVert.  The intptr_t is wrapped in a struct to prevent
the accidental usage of it as an index.

There are many reasons to do this:

* Right now `BMesh` verts are not logical sculpt verts;
  to use the sculpt API they must first be converted to indices.
  This requires a lot of indirect lookups into tables, leading to performance
  loss.  It has also led to greater code complexity and duplication.
* Having an abstract vertex type makes it feasible to have one unified
  temporary attribute API for all three PBVH modes, which in turn
  made it rather trivial to port sculpt brushes to DynTopo in
  sculpt-dev (e.g. the layer brush, draw sharp, the smooth brushes,
  the paint brushes, etc).  This attribute API will be in a future patch.
* We need to do this anyway for the eventual move to C++.

Differential Revision: https://developer.blender.org/D14272
Reviewed By: Brecht Van Lommel
Ref D14272
2022-07-29 19:03:51 -07:00
..
CMakeLists.txt Sculpt: Opaque vertex type for sculpt 2022-07-29 19:03:51 -07:00
geometry_attributes.cc Fix T99036: hex color in "Add Color Attribute" 2022-07-25 12:15:27 +02:00
geometry_intern.hh D14823: Adds operator to duplicate the active color attribute layer 2022-06-08 12:10:32 -07:00
geometry_ops.cc D14823: Adds operator to duplicate the active color attribute layer 2022-06-08 12:10:32 -07:00