[Bf-blender-cvs] [6075b7d3623] greasepencil-object: Fix: Only show GP add shapes panel when GP object is active
Joshua Leung
noreply at git.blender.org
Fri May 4 16:27:20 CEST 2018
Commit: 6075b7d36234ff241f9158bbcce9fec0d290ac2f
Author: Joshua Leung
Date: Fri May 4 16:27:17 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB6075b7d36234ff241f9158bbcce9fec0d290ac2f
Fix: Only show GP add shapes panel when GP object is active
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 476a165bd8b..0252384fb32 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1510,7 +1510,8 @@ class VIEW3D_PT_tools_grease_pencil_shapes(Panel):
@classmethod
def poll(cls, context):
- return (context.space_data.type == 'VIEW_3D')
+ ob = context.active_object
+ return ob and ob.type == 'GPENCIL'
@staticmethod
def draw(self, context):
@@ -1540,8 +1541,6 @@ class VIEW3D_PT_tools_grease_pencil_animation(Panel):
def poll(cls, context):
if context.gpencil_data is None:
return False
- elif context.space_data.type != 'VIEW_3D':
- return False
elif context.active_object.mode == 'OBJECT':
return False
@@ -1574,11 +1573,8 @@ class VIEW3D_PT_tools_grease_pencil_interpolate(Panel):
def poll(cls, context):
if context.gpencil_data is None:
return False
- elif context.space_data.type != 'VIEW_3D':
- return False
gpd = context.gpencil_data
-
return bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
@staticmethod
More information about the Bf-blender-cvs
mailing list