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:
authorCampbell Barton <ideasman42@gmail.com>2010-10-20 13:18:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-20 13:18:55 +0400
commita044486d7d8faf3acc32d7c1d6dbf505c03e3631 (patch)
treeb329a5de607c5aff7ae60e202347a0eefb025d5d /source/blender/modifiers
parentc2aa5d6dc01dbc42ef9815bdbe8917b6164bf840 (diff)
[#24267] Hook fails after Solidify
Solidify modifier wasn't assigning origindex values. - BLI_math.h array functions: range_vni(), mul_vn_fl(), mul_vn_vn_fl(), add_vn_vn(), fill_vni(). - define 'AT' as __FILE__ ":" STRINGIFY(__LINE__), useful for quick debug prints.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 6abe1262c0b..b54f8fdf190 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -196,7 +196,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
int UNUSED(useRenderParams),
int UNUSED(isFinalCalc))
{
- int i;
+ int i, *index;
DerivedMesh *result;
SolidifyModifierData *smd = (SolidifyModifierData*) md;
@@ -321,7 +321,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
dm_calc_normal(dm, vert_nors);
}
- result = CDDM_from_template(dm, numVerts * 2, (numEdges * 2) + newEdges, (numFaces * 2) + newFaces);
+ result = CDDM_from_template(dm, numVerts * 2, (numEdges * 2) + newEdges, (numFaces * 2) + newFaces);
mface = result->getFaceArray(result);
medge = result->getEdgeArray(result);
@@ -336,6 +336,23 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DM_copy_vert_data(dm, result, 0, 0, numVerts);
DM_copy_vert_data(dm, result, 0, numVerts, numVerts);
+ /* CDDM_from_template() gives zero'd ORIGINDEX data, we can know ahead of time what the
+ * indicies will be however it would be better if we could check if the're needed. */
+ index= DM_get_vert_data_layer(result, CD_ORIGINDEX);
+ range_vni(index, numVerts, 0);
+ memcpy(index+numVerts, index, numVerts * sizeof(int));
+
+ index= DM_get_edge_data_layer(result, CD_ORIGINDEX);
+ range_vni(index, numEdges, 0);
+ memcpy(index+numEdges, index, numEdges * sizeof(int));
+ fill_vni(index+numEdges*2, newEdges, ORIGINDEX_NONE);
+
+ index= DM_get_face_data_layer(result, CD_ORIGINDEX);
+ range_vni(index, numFaces, 0);
+ memcpy(index+numFaces, index, numFaces * sizeof(int));
+ fill_vni(index+numFaces*2, newFaces, ORIGINDEX_NONE);
+ /* done setting origindex values */
+
{
static int corner_indices[4] = {2, 1, 0, 3};
int is_quad;