diff options
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_mirror.c | 9 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 21 |
2 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 2b29f2afb9a..3570b62dbdf 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -161,6 +161,15 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, dm->copyPolyArray(dm, CDDM_get_polys(result)); } +#if 1 /* WITH_FREESTYLE generic changes */ + /* if the source DM does not have edge CD_ORIGINDEX layer, then + * the corresponding layer of the result DM is filled with zeros + * (see CDDM_from_template()) */ + if (!CustomData_has_layer(&dm->edgeData, CD_ORIGINDEX)) { + range_vn_i(DM_get_edge_data_layer(result, CD_ORIGINDEX), maxEdges, 0); + } +#endif + /* copy customdata to new geometry, * copy from its self because this data may have been created in the checks above */ DM_copy_vert_data(result, result, 0, maxVerts, maxVerts); diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 9cdd52f2375..e957b4e4572 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -374,6 +374,27 @@ static DerivedMesh *applyModifier( DM_copy_poly_data(dm, result, 0, 0, numFaces); DM_copy_poly_data(dm, result, 0, numFaces, numFaces); +#if 1 /* WITH_FREESTYLE generic changes */ + /* When the input DM has no edge CD_ORIGINDEX layer (i.e., the corresponding + * layer of the result DM is filled with zeros; see CDDM_from_template()), + * set the layer to an identity mapping */ + if (!CustomData_has_layer(&dm->edgeData, CD_ORIGINDEX)) { + int *index = DM_get_edge_data_layer(result, CD_ORIGINDEX); + range_vn_i(index, numEdges, 0); + range_vn_i(index+numEdges, numEdges, 0); + } + /* Do the same for poly CD_ORIGINDEX layer */ + if (!CustomData_has_layer(&dm->polyData, CD_ORIGINDEX)) { + int *index, a; + DM_add_poly_layer(result, CD_ORIGINDEX, CD_CALLOC, NULL); + index = DM_get_poly_data_layer(result, CD_ORIGINDEX); + range_vn_i(index, numFaces, 0); + range_vn_i(index+numFaces, numFaces, 0); + for (a = 0; a < newFaces; a++) + index[numFaces*2+a] = ORIGINDEX_NONE; + } +#endif + /* if the original has it, get the result so we can update it */ face_nors_result = CustomData_get_layer(&result->polyData, CD_NORMAL); |