Attract: Added some poll methods

This commit is contained in:
Sybren A. Stüvel 2016-11-11 09:26:52 +01:00
parent 98beaf7fb7
commit 9c3098cc0d

View File

@ -422,6 +422,10 @@ class ATTRACT_OT_shot_open_in_browser(AttractOperatorMixin, Operator):
bl_label = 'Open in Browser'
bl_description = 'Opens a webbrowser to show the shot on Attract'
@classmethod
def poll(cls, context):
return bool(context.selected_sequences and active_strip(context))
def execute(self, context):
from ..blender import PILLAR_WEB_SERVER_URL
import webbrowser
@ -444,6 +448,10 @@ class AttractShotDelete(AttractOperatorMixin, Operator):
confirm = bpy.props.BoolProperty(name='confirm')
@classmethod
def poll(cls, context):
return bool(context.selected_sequences)
def execute(self, context):
from .. import pillar
@ -492,6 +500,10 @@ class AttractStripUnlink(AttractOperatorMixin, Operator):
bl_label = 'Unlink Shot From This Strip'
bl_description = 'Remove Attract props from the selected strip(s)'
@classmethod
def poll(cls, context):
return bool(context.selected_sequences)
def execute(self, context):
unlinked_ids = set()
@ -852,7 +864,7 @@ class ATTRACT_OT_copy_id_to_clipboard(AttractOperatorMixin, Operator):
@classmethod
def poll(cls, context):
return bool(active_strip(context))
return bool(context.selected_sequences and active_strip(context))
def execute(self, context):
strip = active_strip(context)