diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-11 00:34:08 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-11 00:34:08 +0400 |
commit | f4929ad609727354bb6356aef788e8f2fa92d341 (patch) | |
tree | 03d2957f2e35eb2f7075d406bedf747992f3c262 /source/blender/blenkernel/BKE_multires.h | |
parent | 4c66616f4457098f344d6660a8b011a0bbcd9bbb (diff) |
Add mask support to CCGSubSurf and multires.
* 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.
* Add a new flag to _getSubSurf(), CCG_ALLOC_MASK. If set, space for
an extra layer is allocated, but the number of CCG layers is not set
to include it. This is done because GridPaintMasks are absolute,
rather than being relative to the subdivided output (as MDisp
displacements are), so we skip subdividing paint masks here.
* Add a new flag to subsurf_make_derived_from_derived(),
SUBSURF_ALLOC_PAINT_MASK. This controls whether CCG_ALLOC_MASK is
set for _getSubSurf(). Related, masks are never loaded in during
ss_sync_from_derivedmesh(). After subdivision is finished, if the
alloc mask flag is set, the number of CCG layers is increase to 4
with ccgSubSurf_setNumLayers().
* Add a new flag to multires_make_from_derived(),
MULTIRES_ALLOC_PAINT_MASK. Not all multires functions need paint
mask data (e.g. multiresModifier_base_apply.) This flag is always
set in MOD_multires.c so that subdividing a mesh with a mask updates
properly even when not in sculpt mode.
* Update multiresModifier_disp_run() to apply, calculate, and add mask
elements. It's almost the same as the existing operations with xyz
coordinates, but treats masks as absolute rather than displacements
relative to subdivided values.
* Update multires_customdata_delete to free CD_GRID_PAINT_MASK in
addition to CD_MDISPS.
* Update multires_del_higher() to call the new function
multires_grid_paint_mask_downsample(), which allocates a
lower-resolution paint mask grid and copies values over from the
high-resolution grid.
Diffstat (limited to 'source/blender/blenkernel/BKE_multires.h')
-rw-r--r-- | source/blender/blenkernel/BKE_multires.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h index e695fb83c23..396f849def1 100644 --- a/source/blender/blenkernel/BKE_multires.h +++ b/source/blender/blenkernel/BKE_multires.h @@ -44,7 +44,7 @@ struct MultiresModifierData; struct Object; struct Scene; -/* Delete mesh mdisps */ +/* Delete mesh mdisps and grid paint masks */ void multires_customdata_delete(struct Mesh *me); void multires_mark_as_modified(struct Object *ob, enum MultiresModifiedFlags flags); @@ -62,6 +62,7 @@ void multiresModifier_set_levels_from_disps(struct MultiresModifierData *mmd, st typedef enum { MULTIRES_USE_LOCAL_MMD = 1, MULTIRES_USE_RENDER_PARAMS = 2, + MULTIRES_ALLOC_PAINT_MASK = 4 } MultiresFlags; struct DerivedMesh *multires_make_derived_from_derived(struct DerivedMesh *dm, |