Fix T56665: Assert when selecting object
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Feb 2019 12:32:53 +0000 (23:32 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Feb 2019 12:34:32 +0000 (23:34 +1100)
Selecting object w/ a different mode missed refreshing the screen
areas current tool.

source/blender/editors/object/object_select.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesrna/RNA_access.h
source/blender/windowmanager/intern/wm_toolsystem.c

index aed074907b71f4f339aac66b45e6fa385365a2aa..0ae04ab9b332cad33e24ef151512286d91eb01dd 100644 (file)
@@ -65,6 +65,7 @@
 
 #include "WM_api.h"
 #include "WM_types.h"
+#include "WM_message.h"
 
 #include "ED_armature.h"
 #include "ED_object.h"
@@ -119,11 +120,13 @@ void ED_object_base_select(Base *base, eObjectSelect_Mode mode)
  */
 void ED_object_base_activate(bContext *C, Base *base)
 {
+       struct wmMsgBus *mbus = CTX_wm_message_bus(C);
        Scene *scene = CTX_data_scene(C);
        ViewLayer *view_layer = CTX_data_view_layer(C);
        view_layer->basact = base;
 
        WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
+       WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active);
        DEG_id_tag_update(&CTX_data_scene(C)->id, ID_RECALC_SELECT);
 }
 
index 264e21fa065f23b472b9b856ded701feeaca432f..7648a67da8b71008843b96b14b7c773d2b7859bd 100644 (file)
@@ -1086,6 +1086,9 @@ static void view3d_main_region_message_subscribe(
                WM_msg_subscribe_rna_anon_prop(
                        mbus, Object, mode,
                        &msg_sub_value_region_tag_refresh);
+               WM_msg_subscribe_rna_anon_prop(
+                       mbus, LayerObjects, active,
+                       &msg_sub_value_region_tag_refresh);
        }
 }
 
index 143e2c475d08da9366f258ad8a19e09f1bc0bcc5..834f4245b2109d18fc72aa9a28f561f1043d54fa 100644 (file)
@@ -319,6 +319,7 @@ extern StructRNA RNA_LatticeGpencilModifier;
 extern StructRNA RNA_LatticeModifier;
 extern StructRNA RNA_LatticePoint;
 extern StructRNA RNA_LayerCollection;
+extern StructRNA RNA_LayerObjects;
 extern StructRNA RNA_Library;
 extern StructRNA RNA_Light;
 extern StructRNA RNA_LightProbe;
index d5070b66a67a7c4427fa30a099077d811c232af2..f19c4306b6bcd5fc0e11de0691eee3ec958f81f0 100644 (file)
@@ -881,6 +881,7 @@ void WM_toolsystem_do_msg_notify_tag_refresh(
                .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype),
        };
        WM_toolsystem_refresh(C, workspace, &tkey);
+       WM_toolsystem_refresh_screen_area(workspace, view_layer, sa);
 }
 
 IDProperty *WM_toolsystem_ref_properties_ensure_idprops(bToolRef *tref)