diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-06 13:49:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-06 18:11:51 +0300 |
commit | 8c87af74409a3e6681698ba1bf150dd6155e202f (patch) | |
tree | a9549a2315fed37625e8bd126e91c8855a00147a /source/blender/editors/screen | |
parent | e21ae0bb267a54482108ddd4feed99c89241804b (diff) |
Improvements and fixes to Cycles metadata
This is a request by the studio here to make it possible to see how
many samples were used to render a specific shot or a frame. It is a
bit more tricky than simply stamping number of samples from a scene
since rendering is happening in multiple ranges of samples.
This change makes it so Cycles saves configured number of samples for
the specific view layer, and also stores start sample and number of
samples when rendering only a subrange of all samples.
The format used is "cycles.<view_layer_name>.><field>", which allows
to have information about all layers in a multi-layer EXR file.
Ideally we can store simplified "cycles.<field>" if we know that there
is only one render layer in the file, but detecting this is somewhat
tricky since Cycles operates on an evaluated scene which always have
single view layer.
The metadata is shown in the Metadata panels for clip, image and
sequencer spaces.
Example screenshot which shows the metadata:
{F6527727}
Reviewers: brecht
Reviewed By: brecht
Subscribers: fsiddi
Differential Revision: https://developer.blender.org/D4311
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cafe627372b..e8a393dfc37 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2756,7 +2756,7 @@ static void metadata_draw_imbuf(ImBuf *ibuf, const rctf *rect, int fontid, const for (i = 5; i < 10; i++) { len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i]); if (metadata_is_valid(ibuf, temp_str, i, len)) { - BLF_position(fontid, xmin + ofs_x, ymin, 0.0f); + BLF_position(fontid, xmin + ofs_x, ymin + ofs_y, 0.0f); BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX); ofs_x += BLF_width(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX) + UI_UNIT_X; @@ -2802,6 +2802,7 @@ static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top) for (i = 5; i < 10; i++) { if (metadata_is_valid(ibuf, str, i, 0)) { count = 1; + break; } } } @@ -2886,6 +2887,28 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, GPU_matrix_pop(); } +typedef struct MetadataPanelDrawContext { + uiLayout *layout; +} MetadataPanelDrawContext; + +static void metadata_panel_draw_field( + const char *field, + const char *value, + void *ctx_v) +{ + MetadataPanelDrawContext *ctx = (MetadataPanelDrawContext *)ctx_v; + uiLayout *row = uiLayoutRow(ctx->layout, false); + uiItemL(row, field, ICON_NONE); + uiItemL(row, value, ICON_NONE); +} + +void ED_region_image_metadata_panel_draw(ImBuf *ibuf, uiLayout *layout) +{ + MetadataPanelDrawContext ctx; + ctx.layout = layout; + IMB_metadata_foreach(ibuf, metadata_panel_draw_field, &ctx); +} + void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) { float gridsize, gridstep = 1.0f / 32.0f; |