[Bf-blender-cvs] [16b24358fa9] greasepencil-object: Fix UI panel error
Antonio Vazquez
noreply at git.blender.org
Tue May 9 12:47:34 CEST 2017
Commit: 16b24358fa9f0b1555d5c9a81c6bcd3c4bc031c6
Author: Antonio Vazquez
Date: Tue May 9 12:47:26 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB16b24358fa9f0b1555d5c9a81c6bcd3c4bc031c6
Fix UI panel error
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 644d0b90e7b..f52f9b0954e 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -881,27 +881,28 @@ class GreasePencilDataPanel:
def poll(cls, context):
ts = context.scene.tool_settings
- if ts.grease_pencil_source == 'SCENE':
- if context.space_data.context != 'SCENE':
- return False
-
- if ts.grease_pencil_source == 'OBJECT':
- if context.space_data.context != 'DATA':
- return False
-
if context.gpencil_data is None:
return False
- if context.space_data.context == 'DATA':
- if context.object.type != 'GPENCIL':
- return False
- else:
- if context.object.grease_pencil != context.gpencil_data:
+ if context.space_data.type == 'VIEW_3D':
+ if ts.grease_pencil_source == 'SCENE':
+ if context.space_data.context != 'SCENE':
+ return False
+
+ if ts.grease_pencil_source == 'OBJECT':
+ if context.space_data.context != 'DATA':
+ return False
+
+ if context.space_data.context == 'DATA':
+ if context.object.type != 'GPENCIL':
return False
+ else:
+ if context.object.grease_pencil != context.gpencil_data:
+ return False
- if context.space_data.context == 'SCENE':
- if context.scene.grease_pencil != context.gpencil_data:
- return False
+ if context.space_data.context == 'SCENE':
+ if context.scene.grease_pencil != context.gpencil_data:
+ return False
return True
@@ -943,9 +944,10 @@ class GreasePencilDataPanel:
self.draw_layers(context, layout, gpd)
# convert to object
- if context.space_data.context == 'SCENE':
- row = layout.row()
- row.operator("gpencil.convert_scene_to_object", text="Convert")
+ if context.space_data.type == 'VIEW_3D':
+ if context.space_data.context == 'SCENE':
+ row = layout.row()
+ row.operator("gpencil.convert_scene_to_object", text="Convert")
def draw_layers(self, context, layout, gpd):
row = layout.row()
More information about the Bf-blender-cvs
mailing list