[Bf-blender-cvs] [819af2094b2] master: Rename Sequencer 'Cut' to 'Split'
William Reynish
noreply at git.blender.org
Sun Feb 16 21:39:14 CET 2020
Commit: 819af2094b21a78d57c7480a649f97502c09ec1f
Author: William Reynish
Date: Sun Feb 16 21:39:12 2020 +0100
Branches: master
https://developer.blender.org/rB819af2094b21a78d57c7480a649f97502c09ec1f
Rename Sequencer 'Cut' to 'Split'
This avoids the ambiguity with the Cut operator in the Sequencer, which could be confused with Cut/Copy/Paste.
Use 'Split' for the operator and 'Blade' for the active tool.
Patch by Nathan Lovato, with edits
Differential Revision: https://developer.blender.org/D5542
===================================================================
M release/scripts/presets/keyconfig/keymap_data/blender_default.py
M release/scripts/startup/bl_operators/sequencer.py
M release/scripts/startup/bl_ui/space_sequencer.py
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M source/blender/editors/space_sequencer/sequencer_edit.c
M source/blender/editors/space_sequencer/sequencer_intern.h
M source/blender/editors/space_sequencer/sequencer_ops.c
===================================================================
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index e31e6a77f90..f222513ddc9 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -2397,9 +2397,9 @@ def km_sequencer(params):
items.extend([
*_template_items_select_actions(params, "sequencer.select_all"),
- ("sequencer.cut", {"type": 'K', "value": 'PRESS'},
+ ("sequencer.split", {"type": 'K', "value": 'PRESS'},
{"properties": [("type", 'SOFT')]}),
- ("sequencer.cut", {"type": 'K', "value": 'PRESS', "shift": True},
+ ("sequencer.split", {"type": 'K', "value": 'PRESS', "shift": True},
{"properties": [("type", 'HARD')]}),
("sequencer.mute", {"type": 'H', "value": 'PRESS'},
{"properties": [("unselected", False)]}),
@@ -2450,7 +2450,7 @@ def km_sequencer(params):
("sequencer.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None),
("sequencer.swap_inputs", {"type": 'S', "value": 'PRESS', "alt": True}, None),
*(
- (("sequencer.cut_multicam",
+ (("sequencer.split_multicam",
{"type": NUMBERS_1[i], "value": 'PRESS'},
{"properties": [("camera", i + 1)]})
for i in range(10)
@@ -6120,12 +6120,12 @@ def km_sequencer_editor_tool_select_box(params):
)
-def km_sequencer_editor_tool_cut(_params):
+def km_sequencer_editor_tool_blade(_params):
return (
- "Sequencer Tool: Cut",
+ "Sequencer Tool: Blade",
{"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
- {"items":[
- ("sequencer.cut", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+ {"items": [
+ ("sequencer.split", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("type", 'SOFT'), ("side", 'NO_CHANGE'), ("use_cursor_position", True), ("ignore_selection", True)]}),
]},
)
@@ -6346,7 +6346,7 @@ def generate_keymaps(params=None):
km_3d_view_tool_sculpt_gpencil_select_lasso(params),
km_sequencer_editor_tool_select(params),
km_sequencer_editor_tool_select_box(params),
- km_sequencer_editor_tool_cut(params),
+ km_sequencer_editor_tool_blade(params),
]
# ------------------------------------------------------------------------------
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py
index 9a0028d1f14..206f778195e 100644
--- a/release/scripts/startup/bl_operators/sequencer.py
+++ b/release/scripts/startup/bl_operators/sequencer.py
@@ -79,11 +79,11 @@ class SequencerCrossfadeSounds(Operator):
return {'CANCELLED'}
-class SequencerCutMulticam(Operator):
- """Cut multi-cam strip and select camera"""
+class SequencerSplitMulticam(Operator):
+ """Split multi-cam strip and select camera"""
- bl_idname = "sequencer.cut_multicam"
- bl_label = "Cut multicam"
+ bl_idname = "sequencer.split_multicam"
+ bl_label = "Split multicam"
bl_options = {'REGISTER', 'UNDO'}
camera: IntProperty(
@@ -112,7 +112,7 @@ class SequencerCutMulticam(Operator):
s.select = True
cfra = context.scene.frame_current
- bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
+ bpy.ops.sequencer.split(frame=cfra, type='SOFT', side='RIGHT')
for s in context.scene.sequence_editor.sequences_all:
if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
context.scene.sequence_editor.active_strip = s
@@ -369,7 +369,7 @@ def calculate_duration_frames(context, duration_seconds):
classes = (
SequencerCrossfadeSounds,
- SequencerCutMulticam,
+ SequencerSplitMulticam,
SequencerDeinterlaceSelectedMovies,
SequencerFadesClear,
SequencerFadesAdd,
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index f05a0e18eed..903416b78e6 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -716,8 +716,8 @@ class SEQUENCER_MT_strip(Menu):
layout.menu("SEQUENCER_MT_strip_transform")
layout.separator()
- layout.operator("sequencer.cut", text="Cut").type = 'SOFT'
- layout.operator("sequencer.cut", text="Hold Cut").type = 'HARD'
+ layout.operator("sequencer.split", text="Split").type = 'SOFT'
+ layout.operator("sequencer.split", text="Hold Split").type = 'HARD'
layout.separator()
layout.operator("sequencer.copy", text="Copy")
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 79fd5f85851..02db00e36c0 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1706,22 +1706,23 @@ class _defs_node_edit:
keymap="Node Tool: Links Cut",
)
+
class _defs_sequencer_generic:
@ToolDef.from_fn
- def cut():
+ def blade():
def draw_settings(_context, layout, tool):
- props = tool.operator_properties("sequencer.cut")
+ props = tool.operator_properties("sequencer.split")
row = layout.row()
row.use_property_split = False
row.prop(props, "type", expand=True)
return dict(
- idname="builtin.cut",
- label="Cut",
+ idname="builtin.blade",
+ label="Blade",
icon="ops.sequencer.blade",
cursor='CROSSHAIR',
widget=None,
- keymap="Sequencer Tool: Cut",
+ keymap="Sequencer Tool: Blade",
draw_settings=draw_settings,
)
@@ -2255,15 +2256,16 @@ class SEQUENCER_PT_tools_active(ToolSelectPanelHelper, Panel):
],
'SEQUENCER': [
*_tools_select,
- _defs_sequencer_generic.cut,
+ _defs_sequencer_generic.blade,
],
'SEQUENCER_PREVIEW': [
*_tools_select,
*_tools_annotate,
- _defs_sequencer_generic.cut,
+ _defs_sequencer_generic.blade,
],
}
+
classes = (
IMAGE_PT_tools_active,
NODE_PT_tools_active,
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 2f3f90dc1b1..169564aba80 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -730,15 +730,15 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
}
}
-static Sequence *cut_seq_hard(
- Main *bmain, Scene *scene, Sequence *seq, ListBase *new_seq_list, int cutframe)
+static Sequence *split_seq_hard(
+ Main *bmain, Scene *scene, Sequence *seq, ListBase *new_seq_list, int split_frame)
{
TransSeq ts;
Sequence *seqn = NULL;
bool skip_dup = false;
- /* Unlike soft-cut, it's important to use the same value for both strips. */
- const bool is_end_exact = ((seq->start + seq->len) == cutframe);
+ /* Unlike soft-split, it's important to use the same value for both strips. */
+ const bool is_end_exact = ((seq->start + seq->len) == split_frame);
/* backup values */
ts.start = seq->start;
@@ -758,37 +758,38 @@ static Sequence *cut_seq_hard(
/* Precaution, needed because the length saved on-disk may not match the length saved in the
* blend file, or our code may have minor differences reading file length between versions.
- * This causes hard-cut to fail, see: T47862 */
+ * This causes hard-split to fail, see: T47862 */
if (seq->type != SEQ_TYPE_META) {
BKE_sequence_reload_new_file(bmain, scene, seq, true);
BKE_sequence_calc(scene, seq);
}
- /* Important to offset the start when 'cutframe == seq->start'
+ /* Important to offset the start when 'split_frame == seq->start'
* because we need at least one frame of content after start/end still have clipped it. */
- if ((seq->startstill) && (cutframe <= seq->start)) {
+ if ((seq->startstill) && (split_frame <= seq->start)) {
/* don't do funny things with METAs ... */
if (seq->type == SEQ_TYPE_META) {
skip_dup = true;
- seq->startstill = seq->start - cutframe;
+ seq->startstill = seq->start - split_frame;
}
else {
- seq->start = cutframe - 1;
- seq->startstill = cutframe - seq->startdisp - 1;
+ seq->start = split_frame - 1;
+ seq->startstill = split_frame - seq->startdisp - 1;
seq->anim_endofs += seq->len - 1;
seq->endstill = 0;
}
}
/* normal strip */
else if ((is_end_exact == false) &&
- ((cutframe >= seq->start) && (cutframe <= (seq->start + seq->len)))) {
+ ((split_frame >= seq->start) && (split_frame <= (seq->start + seq->len)))) {
seq->endofs = 0;
seq->endstill = 0;
- seq->anim_endofs += (seq->start + seq->len) - cutframe;
+ seq->anim_endofs += (seq->start + seq->len) - split_frame;
}
/* strips with extended stillframes after */
- else if ((is_end_exact == true) || (((seq->start + seq->len) < cutframe) && (seq->endstill))) {
- seq->endstill -= seq->enddisp - cutframe;
+ else if ((is_end_exact == true) ||
+ (((seq->start + seq->len) < split_frame) && (seq->endstill))) {
+ seq->endstill -= seq->enddisp - split_frame;
/* don't do funny things with METAs ... */
if (seq->type == SEQ_TYPE_META) {
skip_dup = true;
@@ -807,38 +808,38 @@ static Sequence *cut_seq_hard(
if (seqn) {
seqn->flag |= SELECT;
- /* Important not to re-assign this (unlike soft-cut) */
+ /* Important not to re-assign this (unlike soft-split) */
#if 0
- is_end_exact = ((seqn->start + seqn->len) == cutframe);
+ is_end_exact = ((seqn->start + seqn->len) == split_frame);
#endif
/* Second Strip! */
/* strips with extended stillframes before */
- if ((seqn->start
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list