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:
authorCampbell Barton <ideasman42@gmail.com>2012-07-25 17:44:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-25 17:44:07 +0400
commiteed0fda33caf09273d8164c86324c67490e50d53 (patch)
treee42dcb7e6ecc83b526e61655d311db5115189f71 /release/scripts/startup/bl_ui/properties_mask_common.py
parentc01a561ca79c1634efa801909f134229b457aeeb (diff)
add mask buttons into the image space
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_mask_common.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_mask_common.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py
index bc82f3f1e2b..a4a81b01980 100644
--- a/release/scripts/startup/bl_ui/properties_mask_common.py
+++ b/release/scripts/startup/bl_ui/properties_mask_common.py
@@ -25,13 +25,18 @@ import bpy
from bpy.types import Menu
-class MASK_PT_mask():
+class MASK_PT_mask:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
bl_label = "Mask Settings"
bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ space_data = context.space_data
+ return space_data.mask and space_data.mode == 'MASK'
+
def draw(self, context):
layout = self.layout
@@ -43,7 +48,7 @@ class MASK_PT_mask():
col.prop(mask, "frame_end")
-class MASK_PT_layers():
+class MASK_PT_layers:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
@@ -51,9 +56,8 @@ class MASK_PT_layers():
@classmethod
def poll(cls, context):
- sc = context.space_data
-
- return sc.mask and sc.mode == 'MASKEDIT'
+ space_data = context.space_data
+ return space_data.mask and space_data.mode == 'MASK'
def draw(self, context):
layout = self.layout
@@ -104,7 +108,7 @@ class MASK_PT_spline():
sc = context.space_data
mask = sc.mask
- if mask and sc.mode == 'MASKEDIT':
+ if mask and sc.mode == 'MASK':
return mask.layers.active and mask.layers.active.splines.active
return False
@@ -134,7 +138,7 @@ class MASK_PT_point():
sc = context.space_data
mask = sc.mask
- if mask and sc.mode == 'MASKEDIT':
+ if mask and sc.mode == 'MASK':
mask_layer_active = mask.layers.active
return (mask_layer_active and
mask_layer_active.splines.active_point)
@@ -183,13 +187,18 @@ class MASK_PT_display():
bl_label = "Mask Display"
bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ space_data = context.space_data
+ return space_data.mask and space_data.mode == 'MASK'
+
def draw(self, context):
layout = self.layout
- sc = context.space_data
+ space_data = context.space_data
- col.prop(layout, "mask_draw_type", text="")
- col.prop(layout, "show_mask_smooth")
+ layout.prop(space_data, "mask_draw_type", text="")
+ layout.prop(space_data, "show_mask_smooth")
class MASK_PT_tools():
@@ -198,6 +207,11 @@ class MASK_PT_tools():
#~ bl_region_type = 'TOOLS'
bl_label = "Mask Tools"
+ @classmethod
+ def poll(cls, context):
+ space_data = context.space_data
+ return space_data.mask and space_data.mode == 'MASK'
+
def draw(self, context):
layout = self.layout