diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-07 13:13:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-07 13:29:50 +0300 |
commit | ab0bc65c24bdf68c356adb2566f3669153c931ea (patch) | |
tree | 23909478874a13d84e504a905809eb211e62a9e2 /source/blender/modifiers/intern/MOD_dynamicpaint.c | |
parent | cee53160d2bd9067a3d43cc862ce61e36ff70454 (diff) |
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
Diffstat (limited to 'source/blender/modifiers/intern/MOD_dynamicpaint.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_dynamicpaint.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index 3fea556c3e4..b84e46e145c 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -64,10 +64,9 @@ static void freeData(ModifierData *md) dynamicPaint_Modifier_free(pmd); } -static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) +static void requiredDataMask(Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) { DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; - CustomDataMask dataMask = 0; if (pmd->canvas) { DynamicPaintSurface *surface = pmd->canvas->surfaces.first; @@ -76,21 +75,20 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ || surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE) { - dataMask |= CD_MASK_MLOOPUV; + r_cddata_masks->lmask |= CD_MASK_MLOOPUV; } /* mcol */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT || surface->init_color_type == MOD_DPAINT_INITIAL_VERTEXCOLOR) { - dataMask |= CD_MASK_MLOOPCOL; + r_cddata_masks->lmask |= CD_MASK_MLOOPCOL; } /* CD_MDEFORMVERT */ if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) { - dataMask |= CD_MASK_MDEFORMVERT; + r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT; } } } - return dataMask; } static Mesh *applyModifier( |