Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_data_gpencil.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 8b4b927ffde..7a723901e4b 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -36,6 +36,16 @@ class DataButtonsPanel:
@classmethod
def poll(cls, context):
+ return context.gpencil_data
+
+
+class ObjectButtonsPanel:
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
+ bl_context = "data"
+
+ @classmethod
+ def poll(cls, context):
return context.object and context.object.type == 'GPENCIL'
@@ -46,8 +56,7 @@ class LayerDataButtonsPanel:
@classmethod
def poll(cls, context):
- return (context.object and
- context.object.type == 'GPENCIL' and
+ return (context.gpencil_data and
context.active_gpencil_layer)
@@ -103,14 +112,7 @@ class DATA_PT_gpencil_datapanel(Panel):
@classmethod
def poll(cls, context):
- if context.gpencil_data is None:
- return False
-
- ob = context.object
- if ob is not None and ob.type == 'GPENCIL':
- return True
-
- return False
+ return context.gpencil_data
@staticmethod
def draw(self, context):
@@ -294,7 +296,7 @@ class GPENCIL_UL_vgroups(UIList):
layout.label(text="", icon_value=icon)
-class DATA_PT_gpencil_vertexpanel(DataButtonsPanel, Panel):
+class DATA_PT_gpencil_vertexpanel(ObjectButtonsPanel, Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@@ -359,7 +361,7 @@ class DATA_PT_gpencil_strokes(DataButtonsPanel, Panel):
layout.prop(gpd, "use_adaptive_uv", text="Adaptive UVs")
-class DATA_PT_gpencil_display(DataButtonsPanel, Panel):
+class DATA_PT_gpencil_display(ObjectButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_options = {'DEFAULT_CLOSED'}