[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30086] trunk/blender/source/blender/ editors/mesh/editmesh_tools.c: Fix #22776: merge and remove doubles don' t recalculate normals.

Brecht Van Lommel brecht at blender.org
Wed Jul 7 18:23:39 CEST 2010


Revision: 30086
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30086
Author:   blendix
Date:     2010-07-07 18:23:38 +0200 (Wed, 07 Jul 2010)

Log Message:
-----------
Fix #22776: merge and remove doubles don't recalculate normals.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2010-07-07 16:17:18 UTC (rev 30085)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2010-07-07 16:23:38 UTC (rev 30086)
@@ -485,9 +485,13 @@
 
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 
 	/* Return to editmode. */
 	ED_object_enter_editmode(C, 0);
+
+	return OPERATOR_FINISHED;
 }
 
 void MESH_OT_sort_faces(wmOperatorType *ot)





More information about the Bf-blender-cvs mailing list