diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 17 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 13 | ||||
-rw-r--r-- | source/blender/sequencer/intern/render.c | 11 | ||||
-rw-r--r-- | source/blender/sequencer/intern/sequencer.c | 1 |
6 files changed, 48 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 645d049fe71..fe656166ada 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 1 +#define BLENDER_FILE_SUBVERSION 2 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 90730439c51..001dffdca10 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -1107,6 +1107,15 @@ static bool seq_transform_origin_set(Sequence *seq, void *UNUSED(user_data)) return true; } +static bool seq_transform_filter_set(Sequence *seq, void *UNUSED(user_data)) +{ + StripTransform *transform = seq->strip->transform; + if (seq->strip->transform != NULL) { + transform->filter = SEQ_TRANSFORM_FILTER_BILINEAR; + } + return true; +} + static void do_version_subsurface_methods(bNode *node) { if (node->type == SH_NODE_SUBSURFACE_SCATTERING) { @@ -2549,6 +2558,14 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 302, 2)) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + if (scene->ed != NULL) { + SEQ_for_each_callback(&scene->ed->seqbase, seq_transform_filter_set, NULL); + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 5fe67a34dae..70f0dc3f5de 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -80,6 +80,7 @@ typedef struct StripTransform { float rotation; /** 0-1 range, use SEQ_image_transform_origin_offset_pixelspace_get to convert to pixel space. */ float origin[2]; + int filter; } StripTransform; typedef struct StripColorBalance { @@ -788,6 +789,12 @@ typedef enum SequenceColorTag { SEQUENCE_COLOR_TOT, } SequenceColorTag; +/* Sequence->StripTransform->filter */ +enum { + SEQ_TRANSFORM_FILTER_NEAREST = 0, + SEQ_TRANSFORM_FILTER_BILINEAR = 1, +}; + #ifdef __cplusplus } #endif diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 6c3e3ab3058..9fee54ef38d 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1456,6 +1456,12 @@ static void rna_def_strip_crop(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_SequenceCrop_path"); } +static const EnumPropertyItem transform_filter_items[] = { + {SEQ_TRANSFORM_FILTER_NEAREST, "NEAREST", 0, "Nearest", ""}, + {SEQ_TRANSFORM_FILTER_BILINEAR, "BILINEAR", 0, "Bilinear", ""}, + {0, NULL, 0, NULL, NULL}, +}; + static void rna_def_strip_transform(BlenderRNA *brna) { StructRNA *srna; @@ -1502,6 +1508,13 @@ static void rna_def_strip_transform(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1, 1, 3); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update"); + prop = RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "filter"); + RNA_def_property_enum_items(prop, transform_filter_items); + RNA_def_property_enum_default(prop, SEQ_TRANSFORM_FILTER_BILINEAR); + RNA_def_property_ui_text(prop, "Filter", "Type of filter to use for image transformation"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update"); + RNA_def_struct_path_func(srna, "rna_SequenceTransform_path"); } diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index 482425e70d3..a6c627e5ce7 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -524,8 +524,15 @@ static void sequencer_preprocess_transform_crop( const float crop_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f; sequencer_image_crop_init(seq, in, crop_scale_factor, &source_crop); - const eIMBInterpolationFilterMode filter = context->for_render ? IMB_FILTER_BILINEAR : - IMB_FILTER_NEAREST; + eIMBInterpolationFilterMode filter; + const StripTransform *transform = seq->strip->transform; + if (transform->filter == SEQ_TRANSFORM_FILTER_NEAREST) { + filter = IMB_FILTER_NEAREST; + } + else { + filter = IMB_FILTER_BILINEAR; + } + IMB_transform(in, out, IMB_TRANSFORM_MODE_CROP_SRC, filter, transform_matrix, &source_crop); if (!seq_image_transform_transparency_gained(context, seq)) { diff --git a/source/blender/sequencer/intern/sequencer.c b/source/blender/sequencer/intern/sequencer.c index 1c7fe927381..8e824f59dda 100644 --- a/source/blender/sequencer/intern/sequencer.c +++ b/source/blender/sequencer/intern/sequencer.c @@ -85,6 +85,7 @@ static Strip *seq_strip_alloc(int type) strip->transform->scale_y = 1; strip->transform->origin[0] = 0.5f; strip->transform->origin[1] = 0.5f; + strip->transform->filter = SEQ_TRANSFORM_FILTER_BILINEAR; strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop"); } |