diff options
-rw-r--r-- | source/blender/src/editmesh_lib.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 1b238867f67..85f2ace2281 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -80,7 +80,7 @@ void EM_set_actFace(EditFace *efa) EditFace * EM_get_actFace(int sloppy) { - if (G.editMesh->act_face && G.editMesh->act_face->f & SELECT) { + if (G.editMesh->act_face) { return G.editMesh->act_face; } else if (sloppy) { EditFace *efa= NULL; @@ -1100,7 +1100,7 @@ static short extrudeflag_edge(short flag, float *nor) EditMesh *em = G.editMesh; EditVert *eve, *nextve; EditEdge *eed, *nexted; - EditFace *efa, *nextfa; + EditFace *efa, *nextfa, *efan; short del_old= 0; ModifierData *md; @@ -1254,27 +1254,32 @@ static short extrudeflag_edge(short flag, float *nor) if(del_old==0) { // keep old faces means flipping normal if(efa->v4) - addfacelist(efa->v4->tmp.v, efa->v3->tmp.v, + efan = addfacelist(efa->v4->tmp.v, efa->v3->tmp.v, efa->v2->tmp.v, efa->v1->tmp.v, efa, efa); else - addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, + efan = addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, efa->v1->tmp.v, NULL, efa, efa); } else { if(efa->v4) - addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, + efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, efa->v3->tmp.v, efa->v4->tmp.v, efa, efa); else - addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, + efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, efa->v3->tmp.v, NULL, efa, efa); } - + + if (G.editMesh->act_face == efa) { + G.editMesh->act_face = efan; + } + /* for transform */ add_normal_aligned(nor, efa->n); } } if(del_old) { + /* step 4: remove old faces, if del_old */ efa= em->faces.first; while(efa) { @@ -1285,7 +1290,8 @@ static short extrudeflag_edge(short flag, float *nor) } efa= nextfa; } - + + /* step 5: remove selected unused edges */ /* start tagging again */ for(eed= em->edges.first; eed; eed= eed->next) eed->f1=0; @@ -1700,7 +1706,7 @@ void adduplicateflag(int flag) EditMesh *em = G.editMesh; EditVert *eve, *v1, *v2, *v3, *v4; EditEdge *eed, *newed; - EditFace *efa, *newfa; + EditFace *efa, *newfa, *act_efa = EM_get_actFace(0); EM_clear_flag_all(128); EM_selectmode_set(); // paranoia check, selection now is consistant @@ -1747,6 +1753,10 @@ void adduplicateflag(int flag) newfa= addfacelist(v1, v2, v3, v4, efa, efa); + if (act_efa==act_efa) { + EM_set_actFace(newfa); + } + newfa->f= efa->f; efa->f -= flag; efa->f |= 128; |