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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-06-29 21:12:19 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-06-29 21:30:31 +0300
commitfba9cd019f21f29bad1a6f3713370c5172dbc97f (patch)
tree5c42ca8e6f4d2f7051088306e99676d7e8b47b7b /source/blender/sequencer/intern
parentea43ae4194e293599997f1d0d47430b462b4fd7f (diff)
VSE: Improved Snapping
Change snapping behavior to snap strip edges when they are close to snap point. Default behavior is, that each transformed strip is snapped to any other strip. Implement snapping controls in sequencer tool settings. These controls include: - Snapping on/off - Ability to snap to playhead and strip hold offset points - Filter snap points by excluding sound or muted strips - Control snapping distance Snapping controls are placed in timeline header similar to 3D viewport Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11646
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r--source/blender/sequencer/intern/iterator.c8
-rw-r--r--source/blender/sequencer/intern/sequencer.c20
2 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c
index 9bbc5362f18..4df92ce7df4 100644
--- a/source/blender/sequencer/intern/iterator.c
+++ b/source/blender/sequencer/intern/iterator.c
@@ -115,6 +115,14 @@ SeqCollection *SEQ_collection_create(void)
}
/**
+ * Return number of items in collection.
+ */
+uint SEQ_collection_count(SeqCollection *collection)
+{
+ return BLI_gset_len(collection->set);
+}
+
+/**
* Query strips from seqbase. seq_reference is used by query function as filter condition.
*
* \param seq_reference: reference strip for query function
diff --git a/source/blender/sequencer/intern/sequencer.c b/source/blender/sequencer/intern/sequencer.c
index 8cd67195c30..f6b37bdb3ab 100644
--- a/source/blender/sequencer/intern/sequencer.c
+++ b/source/blender/sequencer/intern/sequencer.c
@@ -311,6 +311,8 @@ SequencerToolSettings *SEQ_tool_settings_init(void)
SequencerToolSettings *tool_settings = MEM_callocN(sizeof(SequencerToolSettings),
"Sequencer tool settings");
tool_settings->fit_method = SEQ_SCALE_TO_FIT;
+ tool_settings->snap_mode = SEQ_SNAP_TO_STRIPS | SEQ_SNAP_TO_PLAYHEAD | SEQ_SNAP_TO_STRIP_HOLD;
+ tool_settings->snap_distance = 15;
return tool_settings;
}
@@ -336,6 +338,24 @@ eSeqImageFitMethod SEQ_tool_settings_fit_method_get(Scene *scene)
return tool_settings->fit_method;
}
+short SEQ_tool_settings_snap_mode_get(Scene *scene)
+{
+ const SequencerToolSettings *tool_settings = SEQ_tool_settings_ensure(scene);
+ return tool_settings->snap_mode;
+}
+
+short SEQ_tool_settings_snap_flag_get(Scene *scene)
+{
+ const SequencerToolSettings *tool_settings = SEQ_tool_settings_ensure(scene);
+ return tool_settings->snap_flag;
+}
+
+int SEQ_tool_settings_snap_distance_get(Scene *scene)
+{
+ const SequencerToolSettings *tool_settings = SEQ_tool_settings_ensure(scene);
+ return tool_settings->snap_distance;
+}
+
void SEQ_tool_settings_fit_method_set(Scene *scene, eSeqImageFitMethod fit_method)
{
SequencerToolSettings *tool_settings = SEQ_tool_settings_ensure(scene);