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:
authorCampbell Barton <ideasman42@gmail.com>2016-04-27 08:49:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-04-27 08:49:13 +0300
commit0912bffb848dbb3fd13e736f1f60128e4a36a7f7 (patch)
treee37bc637ad8291fe3f70947bc5a8b28289057672
parent01cdd22a524b0f4a51d52d661268eb3758c68f35 (diff)
Sequencer text strip color options
D1930 by @NiKoZLaB
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py10
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c8
-rw-r--r--source/blender/blenloader/intern/versioning_270.c16
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c10
5 files changed, 42 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 233145819e7..65fd0a43619 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -668,7 +668,15 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col = layout.column()
col.prop(strip, "text")
col.prop(strip, "font_size")
- col.prop(strip, "use_shadow")
+
+ row = col.row()
+ row.prop(strip, "color")
+ row = col.row()
+ row.prop(strip, "use_shadow")
+ rowsub = row.row()
+ rowsub.active = strip.use_shadow
+ rowsub.prop(strip, "shadow_color", text="")
+
col.prop(strip, "align_x")
col.prop(strip, "align_y")
col.prop(strip, "location")
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");