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>2022-05-18 22:26:47 +0300
committerRichard Antalik <richardantalik@gmail.com>2022-05-18 22:26:47 +0300
commit8ca9ce09865e6a617d6c2f78f3483ba1fd5d6aef (patch)
tree371395186f59292cf0d7b94a055da690696336ef /source/blender/sequencer/intern/strip_transform.c
parent47dbdf8dd5744bc61f2e16f8d5c5eb4203ce0c48 (diff)
VSE: Remove still frame offsets
To clarify term still frame: This is portion of strip that displays static image. This area can exist before or after strip movie content. Still frames were implemented as strip property, but this was never displayed in panel. Only way to set still frames was to drag strip handle with mouse or using python API. This would set either `seq->*still` or `seq->*ofs` where * stands for `start` or `end`. When strip had offset, it can't have still frames and vice versa, but this had to be enforced in RNA functions and everywhere in code where these fields are set directly. Strip can not have negative offset or negative number of still frames. This is not very practical approach and still frames can be simply implemented as applying negative offset. Merging these offsets would simplify offset calculations for example in D14962 and could make it easier to also deprecate usage `seq->*disp` and necessity to call update functions to recalculate strip boundaries. For users only functional change is ability to set negative strip offset using property in side panel. Reviewed By: sergey Differential Revision: https://developer.blender.org/D14976
Diffstat (limited to 'source/blender/sequencer/intern/strip_transform.c')
-rw-r--r--source/blender/sequencer/intern/strip_transform.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c
index 2c9ab0a3335..4def31f87e5 100644
--- a/source/blender/sequencer/intern/strip_transform.c
+++ b/source/blender/sequencer/intern/strip_transform.c
@@ -40,35 +40,21 @@ static int seq_tx_get_end(Sequence *seq)
int SEQ_transform_get_left_handle_frame(Sequence *seq)
{
- return (seq->start - seq->startstill) + seq->startofs;
+ return seq->start + seq->startofs;
}
int SEQ_transform_get_right_handle_frame(Sequence *seq)
{
- return ((seq->start + seq->len) + seq->endstill) - seq->endofs;
+ return seq->start + seq->len - seq->endofs;
}
void SEQ_transform_set_left_handle_frame(Sequence *seq, int val)
{
- if (val < (seq)->start) {
- seq->startstill = abs(val - (seq)->start);
- seq->startofs = 0;
- }
- else {
- seq->startofs = abs(val - (seq)->start);
- seq->startstill = 0;
- }
+ seq->startofs = val - seq->start;
}
void SEQ_transform_set_right_handle_frame(Sequence *seq, int val)
{
- if (val > (seq)->start + (seq)->len) {
- seq->endstill = abs(val - (seq->start + (seq)->len));
- seq->endofs = 0;
- }
- else {
- seq->endofs = abs(val - ((seq)->start + (seq)->len));
- seq->endstill = 0;
- }
+ seq->endofs = seq->start + seq->len - val;
}
bool SEQ_transform_single_image_check(Sequence *seq)
@@ -157,8 +143,8 @@ void SEQ_transform_handle_xlimits(Sequence *seq, int leftflag, int rightflag)
/* sounds cannot be extended past their endpoints */
if (seq->type == SEQ_TYPE_SOUND_RAM) {
- seq->startstill = 0;
- seq->endstill = 0;
+ CLAMP(seq->startofs, 0, MAXFRAME);
+ CLAMP(seq->endofs, 0, MAXFRAME);
}
}