diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-29 01:02:44 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-29 01:02:44 +0400 |
commit | 3d98da9b0fcd9d1b61357656cdc448e495be14f2 (patch) | |
tree | 8908352ec13864574e6a5b9bd9f30b6d7b8ef6d1 /source/blender/blenkernel/intern/DerivedMesh.c | |
parent | d3c6c6babd0adc7644d5967464d10cfcdd5251e0 (diff) |
Fix for bug [#31613] Cycles 3d viewport material display mode + skin modifier related crash
When in material display mode, mesh_calc_modifiers() calculates the
orco DerivedMesh, which uses a different CustomDataMask. In
particular, it does not necessarily include the current modifier's
requiredDataMask, so those layers might get set to NO_COPY. For the
skin modifier, this resulted in a crash when the modifier internally
copies the DerivedMesh and the output does not contain the expected
MVertSkin layer.
Fixed by adding the requiredDataMask to the orco DM's CustomDataMask.
Also added a debugging function to customdata.c:
customData_mask_layers__print(CustomDataMask mask);
This will print out the names of all the CD layer types in the mask.
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 7e2d881689c..5774dd7b1ba 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1651,7 +1651,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos orcodm = create_orco_dm(ob, me, NULL, CD_ORCO); nextmask &= ~CD_MASK_ORCO; - DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX); + DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX | + (mti->requiredDataMask ? + mti->requiredDataMask(ob, md) : 0)); ndm = mti->applyModifier(md, ob, orcodm, app_flags & ~MOD_APPLY_USECACHE); if (ndm) { |