diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-07 20:23:38 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-07 20:23:38 +0400 |
commit | 9ab34c36edbb3fc12ff86f95e502bab9d722b11a (patch) | |
tree | 50f291f531c3101731485aa8f693b144a702ab5f /source/blender/editors/mesh/editmesh_tools.c | |
parent | e8be069870b9125e87d533cbb84cf049be5d1442 (diff) |
Fix #22776: merge and remove doubles don't recalculate normals.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 1f112ec1105..681e14dd693 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -485,8 +485,12 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) int count = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit")); - if(count) - BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count); + if(!count) + return OPERATOR_CANCELLED; + + recalc_editnormals(em); + + BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -5860,6 +5864,7 @@ static int merge_exec(bContext *C, wmOperator *op) if(!count) return OPERATOR_CANCELLED; + recalc_editnormals(em); BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices"); @@ -7116,7 +7121,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op) { RegionView3D *rv3d= ED_view3d_context_rv3d(C); View3D *v3d= CTX_wm_view3d(C); - Object *ob= CTX_data_active_object(C); + Object *ob= CTX_data_edit_object(C); Scene *scene= CTX_data_scene(C); Mesh *me; CustomDataLayer *layer; @@ -7125,9 +7130,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op) float reverse = 1; // XXX int ctrl= 0; - if(!ob) return OPERATOR_FINISHED; - if(ob->type!=OB_MESH) return OPERATOR_FINISHED; - if (!v3d) return OPERATOR_FINISHED; + if (!v3d) return OPERATOR_CANCELLED; /* This operator work in Object Mode, not in edit mode. * After talk with Cambell we agree that there is no point to port this to EditMesh right now. @@ -7227,6 +7230,8 @@ static int sort_faces_exec(bContext *C, wmOperator *op) /* Return to editmode. */ ED_object_enter_editmode(C, 0); + + return OPERATOR_FINISHED; } void MESH_OT_sort_faces(wmOperatorType *ot) |