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).
This commit is contained in:
parent
5c6e333780
commit
b49df09d89
Notes:
blender-bot
2023-06-12 00:52:52 +02:00
Referenced by issue #42557, Crash on delete or separate vertices with subsurf modifier + vertex parenting
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue