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:
authorSybren A. Stüvel <sybren@blender.org>2019-09-26 13:05:40 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-09-26 13:05:40 +0300
commitae5bf4c2c83e0f4729544f7f449c641ddccfe554 (patch)
tree43e976fd4b2606ce994389f27006473a5c05104d /source/blender/blenkernel/intern/image.c
parent8a7085b9d45b5e364978672ac50cff4e7ee9e269 (diff)
Fix T67732: metadata "Include Labels" checkbox doesn't work when "Use Strip Metadata" is checked
The 'metadata from sequencer strip' system was using the `stampdata_from_template()` function, which ignored the 'Use Labels' setting.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 170cc230332..bc682ffb8c8 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1861,13 +1861,13 @@ static void stampdata(
}
}
-/* Will always add prefix. */
static void stampdata_from_template(StampData *stamp_data,
const Scene *scene,
- const StampData *stamp_data_template)
+ const StampData *stamp_data_template,
+ bool do_prefix)
{
if (scene->r.stamp & R_STAMP_FILENAME) {
- SNPRINTF(stamp_data->file, "File %s", stamp_data_template->file);
+ SNPRINTF(stamp_data->file, do_prefix ? "File %s" : "%s", stamp_data_template->file);
}
else {
stamp_data->file[0] = '\0';
@@ -1879,67 +1879,71 @@ static void stampdata_from_template(StampData *stamp_data,
stamp_data->note[0] = '\0';
}
if (scene->r.stamp & R_STAMP_DATE) {
- SNPRINTF(stamp_data->date, "Date %s", stamp_data_template->date);
+ SNPRINTF(stamp_data->date, do_prefix ? "Date %s" : "%s", stamp_data_template->date);
}
else {
stamp_data->date[0] = '\0';
}
if (scene->r.stamp & R_STAMP_MARKER) {
- SNPRINTF(stamp_data->marker, "Marker %s", stamp_data_template->marker);
+ SNPRINTF(stamp_data->marker, do_prefix ? "Marker %s" : "%s", stamp_data_template->marker);
}
else {
stamp_data->marker[0] = '\0';
}
if (scene->r.stamp & R_STAMP_TIME) {
- SNPRINTF(stamp_data->time, "Timecode %s", stamp_data_template->time);
+ SNPRINTF(stamp_data->time, do_prefix ? "Timecode %s" : "%s", stamp_data_template->time);
}
else {
stamp_data->time[0] = '\0';
}
if (scene->r.stamp & R_STAMP_FRAME) {
- SNPRINTF(stamp_data->frame, "Frame %s", stamp_data_template->frame);
+ SNPRINTF(stamp_data->frame, do_prefix ? "Frame %s" : "%s", stamp_data_template->frame);
}
else {
stamp_data->frame[0] = '\0';
}
if (scene->r.stamp & R_STAMP_CAMERA) {
- SNPRINTF(stamp_data->camera, "Camera %s", stamp_data_template->camera);
+ SNPRINTF(stamp_data->camera, do_prefix ? "Camera %s" : "%s", stamp_data_template->camera);
}
else {
stamp_data->camera[0] = '\0';
}
if (scene->r.stamp & R_STAMP_CAMERALENS) {
- SNPRINTF(stamp_data->cameralens, "Lens %s", stamp_data_template->cameralens);
+ SNPRINTF(
+ stamp_data->cameralens, do_prefix ? "Lens %s" : "%s", stamp_data_template->cameralens);
}
else {
stamp_data->cameralens[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SCENE) {
- SNPRINTF(stamp_data->scene, "Scene %s", stamp_data_template->scene);
+ SNPRINTF(stamp_data->scene, do_prefix ? "Scene %s" : "%s", stamp_data_template->scene);
}
else {
stamp_data->scene[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SEQSTRIP) {
- SNPRINTF(stamp_data->strip, "Strip %s", stamp_data_template->strip);
+ SNPRINTF(stamp_data->strip, do_prefix ? "Strip %s" : "%s", stamp_data_template->strip);
}
else {
stamp_data->strip[0] = '\0';
}
if (scene->r.stamp & R_STAMP_RENDERTIME) {
- SNPRINTF(stamp_data->rendertime, "RenderTime %s", stamp_data_template->rendertime);
+ SNPRINTF(stamp_data->rendertime,
+ do_prefix ? "RenderTime %s" : "%s",
+ stamp_data_template->rendertime);
}
else {
stamp_data->rendertime[0] = '\0';
}
if (scene->r.stamp & R_STAMP_MEMORY) {
- SNPRINTF(stamp_data->memory, "Peak Memory %s", stamp_data_template->memory);
+ SNPRINTF(stamp_data->memory, do_prefix ? "Peak Memory %s" : "%s", stamp_data_template->memory);
}
else {
stamp_data->memory[0] = '\0';
}
if (scene->r.stamp & R_STAMP_HOSTNAME) {
- SNPRINTF(stamp_data->hostname, "Hostname %s", stamp_data_template->hostname);
+ SNPRINTF(
+ stamp_data->hostname, do_prefix ? "Hostname %s" : "%s", stamp_data_template->hostname);
}
else {
stamp_data->hostname[0] = '\0';
@@ -1991,11 +1995,12 @@ void BKE_image_stamp_buf(Scene *scene,
display_device = scene->display_settings.display_device;
display = IMB_colormanagement_display_get_named(display_device);
+ bool do_prefix = (scene->r.stamp & R_STAMP_HIDE_LABELS) == 0;
if (stamp_data_template == NULL) {
- stampdata(scene, camera, &stamp_data, (scene->r.stamp & R_STAMP_HIDE_LABELS) == 0, true);
+ stampdata(scene, camera, &stamp_data, do_prefix, true);
}
else {
- stampdata_from_template(&stamp_data, scene, stamp_data_template);
+ stampdata_from_template(&stamp_data, scene, stamp_data_template, do_prefix);
}
/* TODO, do_versions */