[Bf-blender-cvs] [f4f5c1152c7] greasepencil-object: Fix: Don't show GP Object's layer data in the Annotation topbar settings
Joshua Leung
noreply at git.blender.org
Fri Jul 27 06:40:55 CEST 2018
Commit: f4f5c1152c7132065245dcf88e4e2bc50fc30712
Author: Joshua Leung
Date: Fri Jul 27 14:03:29 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBf4f5c1152c7132065245dcf88e4e2bc50fc30712
Fix: Don't show GP Object's layer data in the Annotation topbar settings
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index c6015a855cd..d7ab5e3bd33 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -24,6 +24,7 @@
# For now keep this in a single file since it's an area that may change,
# so avoid making changes all over the place.
+import bpy
from bpy.types import Panel
from .space_toolsystem_common import (
@@ -190,8 +191,12 @@ class _defs_annotate:
# XXX: These context checks are needed for layer-dependent settings,
# but this breaks for using topbar for 2D editor active tools, etc.
- gpd = context.gpencil_data
- gpl = context.active_gpencil_layer
+ if type(context.gpencil_data_owner) is bpy.types.Object:
+ gpd = context.scene.grease_pencil
+ else:
+ gpd = context.gpencil_data
+
+ gpl = gpd.layers.active if gpd else None
if gpd and gpl:
layout.prop(gpd.layers, "active_note", text="")
More information about the Bf-blender-cvs
mailing list