diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-08-03 23:27:19 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-08-03 23:27:19 +0400 |
commit | 1db88bd065f9638f235c2a1047b50255de7e05ac (patch) | |
tree | a6060158dbd3dafa2bee6207c19aec495a65af32 /source/blender | |
parent | 45386aeb3ce87a92cdd577307ed9301c65849664 (diff) |
- modify CCG to not crash when passed invalid faces, just ignores
that face... this situation should still not happen with well
written modifiers but at least it won't crash now
- bug fix in mirror modifier, calculation during editmode did not
check to make sure built mface's had valid indices... grr the
==0 tagging system is really a pain.
- convert a few uiDefBut calls to use explicit type
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 49 | ||||
-rw-r--r-- | source/blender/src/drawnla.c | 16 | ||||
-rw-r--r-- | source/blender/src/space.c | 8 |
4 files changed, 26 insertions, 64 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index e88137bc1c9..bec741c64e6 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1016,15 +1016,22 @@ CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGV for (k=0; k<numVerts; k++) { ss->tempVerts[k] = _ehash_lookup(ss->vMap, vHDLs[k]); + + if (!ss->tempVerts[k]) + return eCCGError_InvalidValue; } for (k=0; k<numVerts; k++) { ss->tempEdges[k] = _vert_findEdgeTo(ss->tempVerts[k], ss->tempVerts[(k+1)%numVerts]); - if (ss->allowEdgeCreation && !ss->tempEdges[k]) { - CCGEdge *e = ss->tempEdges[k] = _edge_new((CCGEdgeHDL) -1, ss->tempVerts[k], ss->tempVerts[(k+1)%numVerts], ss->defaultCreaseValue, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); - _ehash_insert(ss->eMap, (EHEntry*) e); - e->v0->flags |= Vert_eEffected; - e->v1->flags |= Vert_eEffected; + if (!ss->tempEdges[k]) { + if (ss->allowEdgeCreation) { + CCGEdge *e = ss->tempEdges[k] = _edge_new((CCGEdgeHDL) -1, ss->tempVerts[k], ss->tempVerts[(k+1)%numVerts], ss->defaultCreaseValue, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + _ehash_insert(ss->eMap, (EHEntry*) e); + e->v0->flags |= Vert_eEffected; + e->v1->flags |= Vert_eEffected; + } else { + return eCCGError_InvalidValue; + } } } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d86b429193b..1eb80220fac 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -543,53 +543,6 @@ static void mirrorModifier__doMirror(MirrorModifierData *mmd, DispListMesh *ndlm if (nmf->v1==mf->v1 && nmf->v2==mf->v2 && nmf->v3==mf->v3 && nmf->v4==mf->v4) continue; - /* Decided this wasn't worth the effort, esp. because the mesh still - * has wierd topology. Can put it back if it appears useful in the end. - * Note it needs some test_mface or so added. - */ -#if 0 - int copyIdx; - - /* If three in order vertices are shared then duplicating the face - * will be strange (don't want two quads sharing three vertices in a - * mesh. Instead modify the original quad to leave out the middle vertice - * and span the gap. Vertice will remain in mesh and still have edges - * to it but will not interfere with normals. - */ - if (nmf->v4==mf->v4 && nmf->v1==mf->v1 && nmf->v2==mf->v2) { - mf->v1 = nmf->v3; - copyIdx = 0; - } else if (nmf->v1==mf->v1 && nmf->v2==mf->v2 && nmf->v3==mf->v3) { - mf->v2 = nmf->v4; - copyIdx = 1; - } else if (nmf->v2==mf->v2 && nmf->v3==mf->v3 && nmf->v4==mf->v4) { - mf->v3 = nmf->v1; - copyIdx = 2; - } else if (nmf->v3==mf->v3 && nmf->v4==mf->v4 && nmf->v1==mf->v1) { - mf->v4 = nmf->v2; - copyIdx = 3; - } else { - copyIdx = -1; - } - - if (copyIdx!=-1) { - int fromIdx = (copyIdx+2)%4; - - if (ndlm->tface) { - tf->col[copyIdx] = ntf->col[fromIdx]; - tf->uv[copyIdx][0] = ntf->uv[fromIdx][0]; - tf->uv[copyIdx][1] = ntf->uv[fromIdx][1]; - } else if (ndlm->mcol) { - mc[copyIdx] = nmc[fromIdx]; - } - - if (mf->v3==0 || nmf->v3==0 || (has4 && (mf->v4==0 || nmf->v4==0))) { - int i = 0; - } - continue; - } -#endif - if (nmf->v3) { /* Need to flip face normal, pick which verts to flip * in order to prevent nmf->v3==0 or nmf->v4==0 @@ -740,6 +693,8 @@ static void *mirrorModifier_applyModifierEM(ModifierData *md, Object *ob, void * mf->v4 = efa->v4?(int) efa->v4->prev:0; mf->mat_nr = efa->mat_nr; mf->flag = efa->flag; + + test_index_mface(mf, efa->v4?4:3); } mirrorModifier__doMirror(mmd, ndlm, vertexCos); diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c index 1b6718a2b51..0fd3aed4229 100644 --- a/source/blender/src/drawnla.c +++ b/source/blender/src/drawnla.c @@ -486,20 +486,20 @@ static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES uiDefBut(block, LABEL, 0, "Options:", 10,60,300,19, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); - uiDefBut(block, NUM|FLO, B_REDR, "Strip Start:", 10,160,150,19, &strip->start, 1.0, MAXFRAMEF, 100, 0, "First frame in the timeline"); - uiDefBut(block, NUM|FLO, B_REDR, "Strip End:", 160,160,150,19, &strip->end, 1.0, MAXFRAMEF, 100, 0, "Last frame in the timeline"); + uiDefButF(block, NUM, B_REDR, "Strip Start:", 10,160,150,19, &strip->start, 1.0, MAXFRAMEF, 100, 0, "First frame in the timeline"); + uiDefButF(block, NUM, B_REDR, "Strip End:", 160,160,150,19, &strip->end, 1.0, MAXFRAMEF, 100, 0, "Last frame in the timeline"); uiBlockBeginAlign(block); - uiDefBut(block, NUM|FLO, B_REDR, "Action Start:", 10,120,150,19, &strip->actstart, 1.0, MAXFRAMEF, 100, 0, "First frame of the action to map to the playrange"); - uiDefBut(block, NUM|FLO, B_REDR, "Action End:", 160,120,150,19, &strip->actend, 1.0, MAXFRAMEF, 100, 0, "Last frame of the action to map to the playrange"); + uiDefButF(block, NUM, B_REDR, "Action Start:", 10,120,150,19, &strip->actstart, 1.0, MAXFRAMEF, 100, 0, "First frame of the action to map to the playrange"); + uiDefButF(block, NUM, B_REDR, "Action End:", 160,120,150,19, &strip->actend, 1.0, MAXFRAMEF, 100, 0, "Last frame of the action to map to the playrange"); uiBlockBeginAlign(block); - uiDefBut(block, NUM|FLO, B_REDR, "Blendin:", 10,80,150,19, &strip->blendin, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-in"); - uiDefBut(block, NUM|FLO, B_REDR, "Blendout:", 160,80,150,19, &strip->blendout, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-out"); + uiDefButF(block, NUM, B_REDR, "Blendin:", 10,80,150,19, &strip->blendin, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-in"); + uiDefButF(block, NUM, B_REDR, "Blendout:", 160,80,150,19, &strip->blendout, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-out"); uiBlockBeginAlign(block); - uiDefBut(block, NUM|FLO, B_REDR, "Repeat:", 10,40,150,19, &strip->repeat, 0.0001, MAXFRAMEF, 100, 0, "Number of times the action should repeat"); - uiDefBut(block, NUM|FLO, B_REDR, "Stride:", 160,40,150,19, &strip->stridelen, 0.0001, MAXFRAMEF, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range"); + uiDefButF(block, NUM, B_REDR, "Repeat:", 10,40,150,19, &strip->repeat, 0.0001, MAXFRAMEF, 100, 0, "Number of times the action should repeat"); + uiDefButF(block, NUM, B_REDR, "Stride:", 160,40,150,19, &strip->stridelen, 0.0001, MAXFRAMEF, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range"); uiBlockBeginAlign(block); uiDefButBitS(block, TOG, ACTSTRIP_USESTRIDE, B_REDR, "Use Path", 10,0,100,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride. Only armatures parented to a path"); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 9a5f7eb47e5..0757a1c1a73 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2664,12 +2664,12 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgsp+mpref+midsp),y2,mpref,buth, &U.fontsize, 0, 0, 0, 0, "Restores to using the default included antialised font"); - uiDefButI(block, MENU|INT, B_SETFONTSIZE, fontsize_pup(), + uiDefButI(block, MENU, B_SETFONTSIZE, fontsize_pup(), (xpos+edgsp+mpref+midsp),y1,mpref,buth, &U.fontsize, 0, 0, 0, 0, "Current interface font size (points)"); /* - uiDefButS(block, MENU|SHO, B_SETENCODING, encoding_pup(), + uiDefButS(block, MENU, B_SETENCODING, encoding_pup(), (xpos+edgsp+mpref+midsp),y1,mpref,buth, &U.encoding, 0, 0, 0, 0, "Current interface font encoding"); @@ -2691,7 +2691,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgsp+(2.2*mpref)+(5*midsp)+(2*spref)),y1,spref,buth, &(U.transopts), 0, 0, 0, 0, "Translate toolbox menu"); - uiDefButI(block, MENU|SHO, B_SETLANGUAGE, language_pup(), + uiDefButI(block, MENU, B_SETLANGUAGE, language_pup(), (xpos+edgsp+(2.2*mpref)+(3*midsp)),y2,mpref+(0.5*mpref)+3,buth, &U.language, 0, 0, 0, 0, "Select interface language"); @@ -2791,7 +2791,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgsp),y2,lpref,buth, &(U.uiflag), 0, 0, 0, 0, "Display a list of input events in the console"); - uiDefButS(block, MENU|SHO, B_CONSOLEOUT, consolemethod_pup(), + uiDefButS(block, MENU, B_CONSOLEOUT, consolemethod_pup(), (xpos+edgsp), y1, lpref,buth, &U.console_out, 0, 0, 0, 0, "Select console output method"); |