glTF importer: add hook before gltf import
[blender-addons.git] / power_sequencer / operators / select_all_left_or_right.py
blob794a9378728ca74e7a4b8adba415593c06fae3e9
1 # SPDX-License-Identifier: GPL-3.0-or-later
2 # Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
3 import bpy
5 from .utils.doc import doc_name, doc_idname, doc_brief, doc_description
8 class POWER_SEQUENCER_OT_select_all_left_or_right(bpy.types.Operator):
9 """
10 *Brief* Selects all strips left or right of the time cursor
11 """
13 doc = {
14 "name": doc_name(__qualname__),
15 "demo": "",
16 "description": doc_description(__doc__),
17 "shortcuts": [
19 {"type": "Q", "value": "PRESS", "shift": True},
20 {"side": "LEFT"},
21 "Select all strips to the LEFT of the time cursor",
24 {"type": "E", "value": "PRESS", "shift": True},
25 {"side": "RIGHT"},
26 "Select all strips to the right of the time cursor",
29 "keymap": "Sequencer",
31 bl_idname = doc_idname(__qualname__)
32 bl_label = doc["name"]
33 bl_description = doc_brief(doc["description"])
34 bl_options = {"REGISTER", "UNDO"}
36 side: bpy.props.EnumProperty(
37 name="Side",
38 description=("Side to select"),
39 items=[
40 ("LEFT", "Left", "Move strips back in time, to the left"),
41 ("RIGHT", "Right", "Move strips forward in time, to the right"),
43 default="LEFT",
46 @classmethod
47 def poll(cls, context):
48 return context.sequences
50 def execute(self, context):
51 if self.side == "LEFT":
52 for s in context.sequences:
53 s.select = s.frame_final_end < context.scene.frame_current
54 else:
55 for s in context.sequences:
56 s.select = s.frame_final_start > context.scene.frame_current
57 return {"FINISHED"}