Blender Git Commit Log
Git Commits -> Revision f4929ad
Revision f4929ad by Nicholas Bishop (master) May 10, 2012, 20:34 (GMT) |
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. |
Commit Details:
Full Hash: f4929ad609727354bb6356aef788e8f2fa92d341
SVN Revision: 46520
Parent Commit: 4c66616
Lines Changed: +144, -27
7 Modified Paths:
/source/blender/blenkernel/BKE_multires.h (+2, -1) (Diff)
/source/blender/blenkernel/BKE_subsurf.h (+2, -1) (Diff)
/source/blender/blenkernel/intern/CCGSubSurf.c (+18, -0) (Diff)
/source/blender/blenkernel/intern/CCGSubSurf.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/multires.c (+100, -23) (Diff)
/source/blender/blenkernel/intern/subsurf_ccg.c (+20, -2) (Diff)
/source/blender/modifiers/intern/MOD_multires.c (+1, -0) (Diff)
/source/blender/blenkernel/BKE_subsurf.h (+2, -1) (Diff)
/source/blender/blenkernel/intern/CCGSubSurf.c (+18, -0) (Diff)
/source/blender/blenkernel/intern/CCGSubSurf.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/multires.c (+100, -23) (Diff)
/source/blender/blenkernel/intern/subsurf_ccg.c (+20, -2) (Diff)
/source/blender/modifiers/intern/MOD_multires.c (+1, -0) (Diff)