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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-11 11:45:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-11 11:45:27 +0300
commitb49df09d89ad130f5f2a993c16a04d9bc2264952 (patch)
tree315a481af6fe8dc4486d2642aba28b69819050df
parent5c6e3337801b493926210e96237be2b495fc5d1b (diff)
Fix T42557: Crash on delete or separate vertices with subsurf modifier + vertex parenting
Only fixes the crash actually, real issue is, vparent does not handle deletion of vertices at all currently... We'd need either some kind of static uuid for vertices, or some mapping helpers used each time we remove or reorder verts... ugh. Org patch by Severin (Julian Eisel).
-rw-r--r--source/blender/blenkernel/intern/object.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 96c5944794e..f2400c958fe 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2199,14 +2199,15 @@ static void give_parvert(Object *par, int nr, float vec[3])
}
if (use_special_ss_case) {
- /* Special case if the last modifier is SS and no constructive modifier
- * are in front of it.
- */
+ /* Special case if the last modifier is SS and no constructive modifier are in front of it. */
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, SET_INT_IN_POINTER(nr));
- float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert);
- add_v3_v3(vec, co);
- count++;
+ /* In case we deleted some verts, nr may refer to inexistent one now, see T42557. */
+ if (ccg_vert) {
+ float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert);
+ add_v3_v3(vec, co);
+ count++;
+ }
}
else if (CustomData_has_layer(&dm->vertData, CD_ORIGINDEX) &&
!(em && dm->type == DM_TYPE_EDITBMESH))