[Bf-blender-cvs] [2b5d4d426a9] blender2.8: Cleanup: use function to set the active base

Campbell Barton noreply at git.blender.org
Mon Sep 10 06:11:46 CEST 2018


Commit: 2b5d4d426a9b8483539d14b6e9ab90da262c2ecb
Author: Campbell Barton
Date:   Mon Sep 10 14:21:11 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB2b5d4d426a9b8483539d14b6e9ab90da262c2ecb

Cleanup: use function to set the active base

===================================================================

M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/mesh/editmesh_path.c
M	source/blender/editors/mesh/editmesh_select.c

===================================================================

diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 365771a1430..bccc8c795b3 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -54,6 +54,7 @@
 #include "WM_types.h"
 
 #include "ED_armature.h"
+#include "ED_object.h"
 #include "ED_screen.h"
 #include "ED_select_utils.h"
 #include "ED_view3d.h"
@@ -723,9 +724,7 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b
 			}
 
 			if (vc.view_layer->basact != basact) {
-				vc.view_layer->basact = basact;
-				DEG_id_tag_update(&vc.scene->id, DEG_TAG_SELECT_UPDATE);
-				WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, vc.scene);
+				ED_object_base_activate(C, basact);
 			}
 		}
 
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index cbfb33af937..5795c8bb938 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -48,6 +48,7 @@
 #include "BKE_editmesh.h"
 #include "BKE_report.h"
 
+#include "ED_object.h"
 #include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_uvedit.h"
@@ -679,9 +680,7 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
 	}
 
 	if (vc.view_layer->basact != basact) {
-		vc.view_layer->basact = basact;
-		DEG_id_tag_update(&vc.scene->id, DEG_TAG_SELECT_UPDATE);
-		WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, vc.scene);
+		ED_object_base_activate(C, basact);
 	}
 
 	/* to support redo */
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 661058f9644..df8c095e7bd 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -57,6 +57,7 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+#include "ED_object.h"
 #include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_transform.h"
@@ -2216,10 +2217,9 @@ bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect
 		/* Changing active object is handy since it allows us to
 		 * switch UV layers, vgroups for eg. */
 		if (vc.view_layer->basact != basact) {
-			vc.view_layer->basact = basact;
-			DEG_id_tag_update(&vc.scene->id, DEG_TAG_SELECT_UPDATE);
-			WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, vc.scene);
+			ED_object_base_activate(C, basact);
 		}
+
 		DEG_id_tag_update(vc.obedit->data, DEG_TAG_SELECT_UPDATE);
 		WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);



More information about the Bf-blender-cvs mailing list