diff options
author | Richard Antalik <richardantalik@gmail.com> | 2019-05-23 21:50:15 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2019-05-23 21:50:15 +0300 |
commit | 1fd7b380f4cf8a0489b405de2819f228a4da5ea2 (patch) | |
tree | a829fdf55a649e1c1d6ebca9a6006ad08e415755 /source/blender | |
parent | a3bc8690387b53234234d1c8f993fa04974d3034 (diff) |
VSE: remove lazy loading for strip crop and transform
Lazy loading prevented showing values in UI.
Now we just gray them out if not used.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 15 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 25 |
3 files changed, 38 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 3fae40d6c7b..7461a1b1051 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -27,7 +27,7 @@ * \note Use #STRINGIFY() rather than defining with quotes. */ #define BLENDER_VERSION 280 -#define BLENDER_SUBVERSION 71 +#define BLENDER_SUBVERSION 72 /** Several breakages with 280, e.g. collections vs layers. */ #define BLENDER_MINVERSION 280 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 92f951ec637..29e9776407d 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -5352,6 +5352,15 @@ static void seq_load_apply(Main *bmain, Scene *scene, Sequence *seq, SeqLoadInfo } } +static Strip *seq_strip_alloc() +{ + Strip *strip = MEM_callocN(sizeof(Strip), "strip"); + strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform"); + strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop"); + + return strip; +} + Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine) { Sequence *seq; @@ -5460,7 +5469,7 @@ Sequence *BKE_sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoad seq->blend_mode = SEQ_TYPE_ALPHAOVER; /* basic defaults */ - seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); + seq->strip = strip = seq_strip_alloc(); seq->len = seq_load->len ? seq_load->len : 1; strip->us = 1; @@ -5515,7 +5524,7 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq); /* basic defaults */ - seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); + seq->strip = strip = seq_strip_alloc(); /* We add a very small negative offset here, because * ceil(132.0) == 133.0, not nice with videos, see T47135. */ seq->len = (int)ceil((double)info.length * FPS - 1e-4); @@ -5647,7 +5656,7 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad } /* basic defaults */ - seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); + seq->strip = strip = seq_strip_alloc(); seq->len = IMB_anim_get_duration(anim_arr[0], IMB_TC_RECORD_RUN); strip->us = 1; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index c4e3390d65f..a783e35f652 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -715,6 +715,23 @@ static void do_version_constraints_copy_scale_power(ListBase *lb) } } +static void do_versions_seq_alloc_transform_and_crop(ListBase *seqbase) +{ + for (Sequence *seq = seqbase->first; seq != NULL; seq = seq->next) { + if (seq->strip->transform == NULL) { + seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform"); + } + + if (seq->strip->crop == NULL) { + seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop"); + } + + if (seq->seqbase.first != NULL) { + do_versions_seq_alloc_transform_and_crop(&seq->seqbase); + } + } +} + void do_versions_after_linking_280(Main *bmain) { bool use_collection_compat_28 = true; @@ -3487,6 +3504,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 280, 72)) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { + if (scene->ed != NULL) { + do_versions_seq_alloc_transform_and_crop(&scene->ed->seqbase); + } + } + } + { /* Versioning code until next subversion bump goes here. */ } |