[Bf-blender-cvs] [4758b4033ec] master: Cleanup: remove unused context check in toolsystem_ref_link

Campbell Barton noreply at git.blender.org
Thu Jun 27 08:43:28 CEST 2019


Commit: 4758b4033ec6c7b3cb85e46ff52ce062e291d0ad
Author: Campbell Barton
Date:   Thu Jun 27 16:40:25 2019 +1000
Branches: master
https://developer.blender.org/rB4758b4033ec6c7b3cb85e46ff52ce062e291d0ad

Cleanup: remove unused context check in toolsystem_ref_link

Also comment corrections.

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

M	source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
M	source/blender/windowmanager/intern/wm_toolsystem.c

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

diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
index f57760cdc2b..beb2707d94d 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
@@ -629,7 +629,7 @@ static wmGizmo *gizmo_find_intersected_3d(bContext *C,
   {
     for (int select_id = 0; select_id < visible_gizmos_len; select_id++) {
       wmGizmo *gz = visible_gizmos[select_id];
-      /* With both defined, favor the 3D, incase the gizmo can be used in 2D or 3D views. */
+      /* With both defined, favor the 3D, in case the gizmo can be used in 2D or 3D views. */
       if (gz->type->test_select && (gz->type->draw_select == NULL)) {
         if ((*r_part = gz->type->test_select(C, gz, co)) != -1) {
           hit = select_id;
@@ -1257,8 +1257,8 @@ void WM_gizmoconfig_update_tag_remove(wmGizmoMapType *gzmap_type, wmGizmoGroupTy
 }
 
 /**
- * Run incase new types have been added (runs often, early exit where possible).
- * Follows #WM_keyconfig_update concentions.
+ * Run in case new types have been added (runs often, early exit where possible).
+ * Follows #WM_keyconfig_update conventions.
  */
 void WM_gizmoconfig_update(struct Main *bmain)
 {
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index fa69d750665..95b072532a4 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -169,9 +169,6 @@ void WM_toolsystem_unlink(bContext *C, WorkSpace *workspace, const bToolKey *tke
   }
 }
 
-/**
- * \see #toolsystem_ref_link
- */
 static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tref)
 {
   bToolRef_Runtime *tref_rt = tref->runtime;
@@ -664,14 +661,7 @@ bToolRef *WM_toolsystem_ref_set_by_id(
   WM_operator_properties_create_ptr(&op_props, ot);
   RNA_string_set(&op_props, "name", name);
 
-  /* Will get from context if not set. */
-  bToolKey tkey_from_context;
-  if (tkey == NULL) {
-    ViewLayer *view_layer = CTX_data_view_layer(C);
-    ScrArea *sa = CTX_wm_area(C);
-    WM_toolsystem_key_from_context(view_layer, sa, &tkey_from_context);
-    tkey = &tkey_from_context;
-  }
+    BLI_assert((1 << tkey->space_type) & WM_TOOLSYSTEM_SPACE_MASK);
 
   BLI_assert((1 << tkey->space_type) & WM_TOOLSYSTEM_SPACE_MASK);



More information about the Bf-blender-cvs mailing list