Welcome to mirror list, hosted at ThFree Co, Russian Federation.

trim.py « tools « power_sequencer - git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c60b2d0c875ef751e9d333b9f7cc2db6d5d9c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors

# This file is part of Power Sequencer.

import bpy
from bpy.types import WorkSpaceTool


class POWER_SEQUENCER_TOOL_Trim(WorkSpaceTool):
    bl_space_type = "SEQUENCE_EDITOR"
    bl_context_mode = "SEQUENCER"

    bl_idname = "power_sequencer.trim"
    bl_label = "Trim"
    bl_description = "Cut and trim strips with the mouse"
    bl_icon = "ops.mesh.knife_tool"
    bl_widget = None
    bl_keymap = (
        (
            "power_sequencer.mouse_trim",
            {"type": "LEFTMOUSE", "value": "PRESS"},
            {"select_mode": "CONTEXT", "gap_remove": False},
        ),
        (
            "power_sequencer.mouse_trim",
            {"type": "LEFTMOUSE", "value": "PRESS", "shift": True},
            {"select_mode": "CURSOR", "gap_remove": True},
        ),
    )

    def draw_settings(context, layout, tool):
        props = tool.operator_properties("power_sequencer.mouse_trim")
        layout.prop(props, "mode")