Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-05-29 01:02:44 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-05-29 01:02:44 +0400
commit3d98da9b0fcd9d1b61357656cdc448e495be14f2 (patch)
tree8908352ec13864574e6a5b9bd9f30b6d7b8ef6d1 /source/blender/blenkernel/intern
parentd3c6c6babd0adc7644d5967464d10cfcdd5251e0 (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')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c4
-rw-r--r--source/blender/blenkernel/intern/customdata.c11
2 files changed, 14 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) {
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 4e7653e2473..3802d532c5b 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1193,6 +1193,17 @@ static const char *layerType_getName(int type)
return LAYERTYPENAMES[type];
}
+void customData_mask_layers__print(CustomDataMask mask)
+{
+ int i;
+
+ printf("mask=0x%lx:\n", mask);
+ for (i = 0; i < CD_NUMTYPES; i++) {
+ if (mask & CD_TYPE_AS_MASK(i))
+ printf(" %s\n", layerType_getName(i));
+ }
+}
+
/********************* CustomData functions *********************/
static void customData_update_offsets(CustomData *data);