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
.doc
import doc_name
, doc_idname
, doc_brief
, doc_description
10 class POWER_SEQUENCER_OT_markers_snap_matching_strips(bpy
.types
.Operator
):
12 Snap selected strips to markers with the same name
16 "name": doc_name(__qualname__
),
18 "description": doc_description(__doc__
),
20 "keymap": "Sequencer",
22 bl_idname
= doc_idname(__qualname__
)
23 bl_label
= doc
["name"]
24 bl_description
= doc_brief(doc
["description"])
25 bl_options
= {"REGISTER", "UNDO"}
28 def poll(cls
, context
):
29 return context
.scene
.timeline_markers
31 def execute(self
, context
):
32 timeline_markers
= context
.scene
.timeline_markers
34 for strip
in context
.selected_sequences
:
35 for marker
in timeline_markers
:
36 if marker
.name
in strip
.name
:
37 strip
.frame_start
= marker
.frame
- strip
.frame_offset_start