1 # SPDX-FileCopyrightText: 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
3 # SPDX-License-Identifier: GPL-3.0-or-later
7 from .utils
.functions
import get_frame_range
9 from .utils
.doc
import doc_name
, doc_idname
, doc_brief
, doc_description
12 class POWER_SEQUENCER_OT_meta_resize_to_content(bpy
.types
.Operator
):
14 *brief* Moves the handles of the selected metastrip so it fits its content
17 Use it to trim a metastrip quickly
21 "name": doc_name(__qualname__
),
23 "description": doc_description(__doc__
),
25 "keymap": "Sequencer",
27 bl_idname
= doc_idname(__qualname__
)
28 bl_label
= doc
["name"]
29 bl_description
= doc_brief(doc
["description"])
30 bl_options
= {"REGISTER", "UNDO"}
33 def poll(cls
, context
):
34 return context
.selected_sequences
36 def execute(self
, context
):
37 selected_meta_strips
= (s
for s
in context
.selected_sequences
if s
.type == "META")
38 for s
in selected_meta_strips
:
39 s
.frame_final_start
, s
.frame_final_end
= get_frame_range(s
.sequences
)