diff options
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index f07364cd4d3..3cfe6bd61a4 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -19,6 +19,7 @@ #include "BKE_collection.h" #include "BKE_global.h" +#include "BKE_layer.h" #include "BKE_lib_id.h" #include "BKE_lib_remap.h" #include "BKE_main.h" @@ -40,6 +41,7 @@ #include "ED_mesh.h" #include "ED_object.h" #include "ED_paint.h" +#include "ED_screen.h" #include "ED_space_api.h" #include "ED_util.h" @@ -137,8 +139,12 @@ void ED_editors_init(bContext *C) ED_object_posemode_enter_ex(bmain, ob); } - /* Other edit/paint/etc. modes are only settable for objects in active scene currently. */ - if (!BKE_collection_has_object_recursive(scene->master_collection, ob)) { + /* Other edit/paint/etc. modes are only settable for objects visible in active scene currently. + * Otherwise, they (and their obdata) may not be (fully) evaluated, which is mandatory for some + * modes like Sculpt. + * Ref. T98225. */ + if (!BKE_collection_has_object_recursive(scene->master_collection, ob) || + !BKE_scene_has_object(scene, ob) || (ob->visibility_flag & OB_HIDE_VIEWPORT) != 0) { continue; } @@ -182,6 +188,18 @@ void ED_editors_init(bContext *C) ED_space_image_paint_update(bmain, wm, scene); } + /* Enforce a full redraw for the first time areas/regions get drawn. Further region init/refresh + * just triggers non-rebuild redraws (#RGN_DRAW_NO_REBUILD). Usually a full redraw would be + * triggered by a `NC_WM | ND_FILEREAD` notifier, but if a startup script calls an operator that + * redraws the window, notifiers are not handled before the operator runs. See T98461. */ + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { + const bScreen *screen = WM_window_get_active_screen(win); + + ED_screen_areas_iter (win, screen, area) { + ED_area_tag_redraw(area); + } + } + ED_assetlist_storage_tag_main_data_dirty(); SWAP(int, reports->flag, reports_flag_prev); |