diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 16 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 10 |
4 files changed, 33 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index dfce931cbf4..ef447412f2b 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -3084,6 +3084,10 @@ static void init_text_effect(Sequence *seq) data = seq->effectdata = MEM_callocN(sizeof(TextVars), "textvars"); data->text_size = 30; + + copy_v4_fl(data->color, 1.0f); + data->shadow_color[3] = 1.0f; + BLI_strncpy(data->text, "Text", sizeof(data->text)); data->loc[0] = 0.5f; @@ -3188,11 +3192,11 @@ static ImBuf *do_text_effect(const SeqRenderData *context, Sequence *seq, float fontx = BLF_width_max(mono); fonty = line_height; BLF_position(mono, x + max_ii(fontx / 25, 1), y + max_ii(fonty / 25, 1), 0.0f); - BLF_buffer_col(mono, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f}); + BLF_buffer_col(mono, data->shadow_color); BLF_draw_buffer(mono, data->text, BLF_DRAW_STR_DUMMY_MAX); } BLF_position(mono, x, y, 0.0f); - BLF_buffer_col(mono, (const float[4]){1.0f, 1.0f, 1.0f, 1.0f}); + BLF_buffer_col(mono, data->color); BLF_draw_buffer(mono, data->text, BLF_DRAW_STR_DUMMY_MAX); BLF_buffer(mono, NULL, NULL, 0, 0, 0, NULL); diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 18740d43a26..54b2582c56c 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1084,5 +1084,21 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { + Sequence *seq; + + SEQ_BEGIN (scene->ed, seq) + { + if (seq->type == SEQ_TYPE_TEXT) { + TextVars *data = seq->effectdata; + if (data->color[3] == 0.0f) { + copy_v4_fl(data->color, 1.0f); + data->shadow_color[3] = 1.0f; + } + } + } + SEQ_END + } + } } diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 3a64890a84b..1f4e4df4660 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -274,6 +274,7 @@ typedef struct GaussianBlurVars { typedef struct TextVars { char text[512]; int text_size; + float color[4], shadow_color[4]; float loc[2]; float wrap_width; char flag; diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index e8a45e6a77d..68d4f7f7e51 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -2330,6 +2330,16 @@ static void rna_def_text(StructRNA *srna) RNA_def_property_ui_range(prop, 0.0f, 1000, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "color"); + RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); + + prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "shadow_color"); + RNA_def_property_ui_text(prop, "Shadow Color", ""); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); + prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", "Location of the text"); |