diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 02:41:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 02:52:25 +0300 |
commit | af0ab15e1dd84aadb32ee8d7a836a08fe6251474 (patch) | |
tree | 4eabb3847dc1a28e68d052837d74fa5d59bc177c /source/blender/editors | |
parent | 3ea7a5d8699c74ddf4ea7b359022145e44f62bc2 (diff) |
Fix T62436: New added Torus won't appear in Local View
Add Object.local_view_get/set
Alternate fix which supports removing from local view & checking
if an object is in local view.
Also avoids redundant refresh.
Matches 2.7x Object.layer_local_view capabilities more closely,
without exposing the flag directly.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 5d4f0919c44..363cea0c1c6 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -41,6 +41,7 @@ struct Main; struct MenuType; struct PropertyRNA; struct Scene; +struct SpaceLink; struct ViewLayer; struct WorkSpace; struct WorkSpaceInstanceHook; @@ -195,6 +196,7 @@ void ED_screens_navigation_bar_tools_menu_create(struct bContext *C, struct u bool ED_screen_stereo3d_required(const struct bScreen *screen, const struct Scene *scene); Scene *ED_screen_scene_find(const struct bScreen *screen, const struct wmWindowManager *wm); Scene *ED_screen_scene_find_with_window(const struct bScreen *screen, const struct wmWindowManager *wm, struct wmWindow **r_window); +ScrArea *ED_screen_area_find_with_spacedata(const bScreen *screen, const struct SpaceLink *sl, bool only_visible); struct wmWindow *ED_screen_window_find(const struct bScreen *screen, const struct wmWindowManager *wm); void ED_screen_preview_render(const struct bScreen *screen, int size_x, int size_y, unsigned int *r_rect) ATTR_NONNULL(); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 8c38ba41821..e5d23457daf 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1539,6 +1539,24 @@ Scene *ED_screen_scene_find_with_window(const bScreen *screen, const wmWindowMan return NULL; } +ScrArea *ED_screen_area_find_with_spacedata(const bScreen *screen, const SpaceLink *sl, const bool only_visible) +{ + if (only_visible) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + if (sa->spacedata.first == sl) { + return sa; + } + } + } + else { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + if (BLI_findindex(&sa->spacedata, sl) != -1) { + return sa; + } + } + } + return NULL; +} Scene *ED_screen_scene_find(const bScreen *screen, const wmWindowManager *wm) { |