Attract: Added some poll methods
This commit is contained in:
parent
98beaf7fb7
commit
9c3098cc0d
@ -422,6 +422,10 @@ class ATTRACT_OT_shot_open_in_browser(AttractOperatorMixin, Operator):
|
|||||||
bl_label = 'Open in Browser'
|
bl_label = 'Open in Browser'
|
||||||
bl_description = 'Opens a webbrowser to show the shot on Attract'
|
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):
|
def execute(self, context):
|
||||||
from ..blender import PILLAR_WEB_SERVER_URL
|
from ..blender import PILLAR_WEB_SERVER_URL
|
||||||
import webbrowser
|
import webbrowser
|
||||||
@ -444,6 +448,10 @@ class AttractShotDelete(AttractOperatorMixin, Operator):
|
|||||||
|
|
||||||
confirm = bpy.props.BoolProperty(name='confirm')
|
confirm = bpy.props.BoolProperty(name='confirm')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return bool(context.selected_sequences)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
from .. import pillar
|
from .. import pillar
|
||||||
|
|
||||||
@ -492,6 +500,10 @@ class AttractStripUnlink(AttractOperatorMixin, Operator):
|
|||||||
bl_label = 'Unlink Shot From This Strip'
|
bl_label = 'Unlink Shot From This Strip'
|
||||||
bl_description = 'Remove Attract props from the selected strip(s)'
|
bl_description = 'Remove Attract props from the selected strip(s)'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return bool(context.selected_sequences)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
unlinked_ids = set()
|
unlinked_ids = set()
|
||||||
|
|
||||||
@ -852,7 +864,7 @@ class ATTRACT_OT_copy_id_to_clipboard(AttractOperatorMixin, Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return bool(active_strip(context))
|
return bool(context.selected_sequences and active_strip(context))
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
strip = active_strip(context)
|
strip = active_strip(context)
|
||||||
|
Reference in New Issue
Block a user