[Bf-blender-cvs] [41f4d210796] blender2.8: Fix part of T56654: Freestyle hiding viewlayer buttons when there is no lineset.
Bastien Montagne
noreply at git.blender.org
Sun Sep 2 15:30:25 CEST 2018
Commit: 41f4d210796dbfa5159fa6fe0b67094e62f25974
Author: Bastien Montagne
Date: Sun Sep 2 15:28:03 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB41f4d210796dbfa5159fa6fe0b67094e62f25974
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...
===================================================================
M source/blender/editors/space_buttons/buttons_context.c
===================================================================
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) ?
More information about the Bf-blender-cvs
mailing list