forked from bartvdbraak/blender
- bug fix for #2948, made ccgSubSurf bail (completely) when it encounters
an inconsistent mesh. I would really like this to be corrected at some other stage, probably on loading, but at least things shouldn't crash now.
This commit is contained in:
parent
f105f96175
commit
8649197925
@ -637,7 +637,26 @@ static void ss_sync_from_mesh(CCGSubSurf *ss, Mesh *me, DispListMesh *dlm, float
|
||||
fVerts[2] = (CCGVertHDL) mf->v3;
|
||||
fVerts[3] = (CCGVertHDL) mf->v4;
|
||||
|
||||
ccgSubSurf_syncFace(ss, (CCGFaceHDL) i, fVerts[3]?4:3, fVerts, &f);
|
||||
// this is very bad, means mesh is internally consistent.
|
||||
// it is not really possible to continue without modifying
|
||||
// other parts of code significantly to handle missing faces.
|
||||
// since this really shouldn't even be possible we just bail.
|
||||
if (ccgSubSurf_syncFace(ss, (CCGFaceHDL) i, fVerts[3]?4:3, fVerts, &f)==eCCGError_InvalidValue) {
|
||||
static int hasGivenError = 0;
|
||||
|
||||
if (!hasGivenError) {
|
||||
if (me) {
|
||||
error("Unrecoverable error in SubSurf calculation, mesh is inconsistent.");
|
||||
} else {
|
||||
error("Unrecoverable error in SubSurf calculation, mesh(%s) is inconsistent.", me->id.name+2);
|
||||
}
|
||||
|
||||
hasGivenError = 1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
((int*) ccgSubSurf_getFaceUserData(ss, f))[1] = index;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user