Export_3ds: Improved distance cue node search
[blender-addons.git] / power_sequencer / operators / meta_resize_to_content.py
blob1ecb5f104cd837cbc060a14f1353c58ce3889d8b
1 # SPDX-FileCopyrightText: 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
3 # SPDX-License-Identifier: GPL-3.0-or-later
6 import bpy
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):
13 """
14 *brief* Moves the handles of the selected metastrip so it fits its content
17 Use it to trim a metastrip quickly
18 """
20 doc = {
21 "name": doc_name(__qualname__),
22 "demo": "",
23 "description": doc_description(__doc__),
24 "shortcuts": [],
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"}
32 @classmethod
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)
40 return {"FINISHED"}