poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'. de-duplicated poll functions and made some minor tweaks too.
This commit is contained in:
@@ -30,8 +30,8 @@ class SequencerCrossfadeSounds(bpy.types.Operator):
|
||||
bl_label = "Crossfade sounds"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
|
||||
return context.scene.sequence_editor.active_strip.type == 'SOUND'
|
||||
else:
|
||||
@@ -84,8 +84,8 @@ class SequencerCutMulticam(bpy.types.Operator):
|
||||
camera = IntProperty(name="Camera",
|
||||
default=1, min=1, max=32, soft_min=1, soft_max=32)
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip:
|
||||
return context.scene.sequence_editor.active_strip.type == 'MULTICAM'
|
||||
else:
|
||||
@@ -119,8 +119,8 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
|
||||
bl_label = "Deinterlace Movies"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if context.scene and context.scene.sequence_editor:
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user