Code cleanup for multires_dm_create_from_derived().

Changed name to multires_make_derived_from_derived() and parameter
order to be more similar to subsurf_make_derived_from_derived().

Added MultiresFlags enum with flag values to replace the local_mmd and
useRenderParams parameters.
Add an RNA access function to get an enum item name from its value.

New function is RNA_enum_name_from_value.
Add new options to PAINT_OT_brush_select, toggle and create_missing.

The toggle option, if enabled, will toggle back and forth between two
brushes. (The first brush of the desired tool type will be toggled to,
running the toggle again switches back to the previously selected
brush.)

If no brush of the desired type is found, and the create_missing
option is enabled, a new brush of that type will be created and set.
Modify CCGSubsurf to subdivide an arbitrary number of (float) layers.

The layout of vert data in CCGSubSurf is almost the same; previously
it was three floats (for xyz coordinate) optionally followed by three
floats for the normal. The only change is that the first three floats
can now be any number of floats.

* _getSubSurf takes a numLayers parameter to set the number of layers,
  stored in CCGMeshIFC.numLayers.

* All calls to _getSubSurf currently have numLayers set to 3, except
  for UV subsurf, where it is reduced to 2 (with a corresponding
  change when reading the results out to use float (*)[2] rather than
  float (*)[3].)

* The various VertData* macros in CCGSubSurf.c are now functions that
  take a CCGSubSurf pointer, which provides access to CCGMeshIFC,
  which has numLayers.

* The rest of the changes are just adding the 'ss' parameter.
Add CCGKey/CCGElem for accessing CCGSubSurf elements.

CCGKey caches information about the CCGSubSurf element layout. This
data, along with the CCG_* inline functions, allows access to
CCGSubSurf elements with an arbitrary number of layers (as opposed to
the hardcoded DMGridData structure which assumes xyz coordinates
followed by three normal components.)

The CCGElem structure is declared but not defined anywhere, just used
as a convenient type.
Replace hardcoded DMGridData structure with CCGElem/CCGKey.

* Changes to DerivedMesh interface: DMGridData has been removed,
  getGridData() now returns an array of CCGElem pointers. Also added
  getGridKey() to initialize a CCGKey (implemented only by
  CCGDerivedMesh.)

* PBVH: added BLI_pbvh_get_grid_key().

* A lot of code is affected, but mainly is just replacing
  DMGridData.co, DMGridData.no, and sizeof(DMGridData) with the
  CCG_*_elem functions, removing the reliance on grid elements of
  exactly six floats.
Add DNA and customdata entries for paint masks.

CD_PAINT_MASK is a layer of per-vertex floats for non-multires
meshes. Multires meshes use CD_GRID_PAINT_MASK, which is a layer of
per-loop GridPaintMask structures. GridPaintMask is similar to MDisp,
but contains an array of scalar floats.

Note: the GridPaintMask could be folded into MDisp, but this way
should be easier to add mask layers in the future (if we do fold
GridPaintMask into MDisp, the mask array should probably be an array
of arrays with a 'totmask' field so that mask layers can be easily
supported.)

Includes blenload read/write support for CD_PAINT_MASK and
CD_GRID_PAINT_MASK.
Add access to mesh vertex customdata to the PBVH.
Add paint mask access to the PBVH vertex iterator.
Copy GridPaintMask to vertex paint mask when applying multires
Add GridPaintMask accessor to paint.c.
WIP: allocate paint mask in CCG and apply/update in multires.c

TODO:
setNumLayers, own commit?

* Add new CCG function ccgSubSurf_setAllocMask(). Similar to to
  ccgSubSurf_setCalcVertexNormals(), it sets whether the CCG elements
  have a mask layer and what that layer's offset is. Unlike normals
  however, it doesn't change any behavior during CCG calculation; it's
  there only to give CCGKey information on the mask.

* Update multires_customdata_delete to free CD_GRID_PAINT_MASK in
  addition to CD_MDISPS.
Fix paint mask grid downsampling
Ensure mask layers are always present in sculpt mode.
Add undo/redo support for paint masks.
Use paint mask when calculating sculpt strength.
Add new mask-brush icon from Julio Iglesias.
Add mask brush for sculpt mode.

The mask brush currently has two modes, 'draw' and 'smooth'.
Add MKEY to the sculpt keymap to toggle the mask brush.
Support shift-key smoothing of the mask.