1 # SPDX-License-Identifier: GPL-3.0-or-later
2 # Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
4 # This file is part of Power Sequencer.
8 from .utils
.doc
import doc_name
, doc_idname
, doc_brief
, doc_description
11 class POWER_SEQUENCER_OT_set_timeline_range(bpy
.types
.Operator
):
13 Set the timeline start and end frame using the time cursor
17 "name": doc_name(__qualname__
),
19 "description": doc_description(__doc__
),
21 "keymap": "Sequencer",
23 bl_idname
= doc_idname(__qualname__
)
24 bl_label
= doc
["name"]
25 bl_description
= doc_brief(doc
["description"])
26 bl_options
= {"REGISTER", "UNDO"}
28 adjust
: bpy
.props
.EnumProperty(
29 items
=[("start", "start", "start"), ("end", "end", "end")],
31 description
="Change the start or the end frame of the timeline",
36 def poll(cls
, context
):
37 return context
.scene
.sequence_editor
39 def execute(self
, context
):
41 if self
.adjust
== "start":
42 scene
.frame_start
= scene
.frame_current
43 elif self
.adjust
== "end":
44 scene
.frame_end
= scene
.frame_current
- 1