Commit: b49df09d89ad130f5f2a993c16a04d9bc2264952
Author: Bastien Montagne
Date:   Tue Nov 11 09:45:27 2014 +0100
Branches: master
https://developer.blender.org/rBb49df09d89ad130f5f2a993c16a04d9bc2264952

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).

===================================================================

M       source/blender/blenkernel/intern/object.c

===================================================================

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 96c5944..f2400c9 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))

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to