diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-02 16:28:03 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-02 16:30:06 +0300 |
commit | 41f4d210796dbfa5159fa6fe0b67094e62f25974 (patch) | |
tree | 5930a7c7561971c3e9acfe1660c1dd1c6ec3bacf /source/blender/editors/space_buttons/buttons_context.c | |
parent | 32e8f2e982193a04c5dac39fdc667aa089e3aaa7 (diff) |
Fix part of T56654: Freestyle hiding viewlayer buttons when there is no lineset.
Buttons' context 'path' has to bee handled carefully, especially when
building more than one step in a single call...
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 05992bbd22d..e27dace4ba5 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -118,6 +118,13 @@ static int buttons_context_path_scene(ButsContextPath *path) static int buttons_context_path_view_layer(ButsContextPath *path, wmWindow *win) { + PointerRNA *ptr = &path->ptr[path->len - 1]; + + /* View Layer may have already been resolved in a previous call (e.g. in buttons_context_path_linestyle). */ + if (RNA_struct_is_a(ptr->type, &RNA_ViewLayer)) { + return 1; + } + if (buttons_context_path_scene(path)) { Scene *scene = path->ptr[path->len - 1].data; ViewLayer *view_layer = (win->scene == scene) ? |