The sculpt branch has new tools for masking, filtering, transforming, etc. This task is about merging those tools to master, and issues to solve before that is possible.
Mesh Data Structures
The main issue right now is that they only work for regular meshes, not multires and dyntopo.
For dyntopo using BMesh, some abstraction can be added in the code mainly to access neighboring vertices, and storing temporary per-vertex data. This data can be stored in arrays in SculptSession, and BM_elem_index_get(v) can be used for indexing into the arrays. This data does not need to preserved when changing topology, so we can just remove then to avoid accessing invalid data.
For multires things are more complicated. What we propose to do here instead is to remove the multires memory optimization which avoids creating a full Mesh and keeps data in grids in sculpt mode. The real-world advantages of this are questionable in the current architecture anyway. Instead there would just be a Mesh and BMesh for the sculpting and drawing code to deal with, and data would be synced to/from grids when exiting/entering sculpt mode. This will hopefully lead to much simplified code, but we have to verify that performance and memory usage remains acceptable.