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/space_clip/clip_buttons.c | |
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/space_clip/clip_buttons.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_buttons.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index 3810b60adf2..4b91d98718d 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -29,8 +29,9 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" -#include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_listbase.h" +#include "BLI_math.h" #include "BLI_path_util.h" #include "BLI_string.h" @@ -43,7 +44,9 @@ #include "DEG_depsgraph.h" +#include "ED_clip.h" #include "ED_gpencil.h" +#include "ED_screen.h" #include "UI_interface.h" #include "UI_resources.h" @@ -60,9 +63,38 @@ /* Panels */ -void ED_clip_buttons_register(ARegionType *UNUSED(art)) +static bool metadata_panel_context_poll(const bContext *C, PanelType *UNUSED(pt)) +{ + return ED_space_clip_poll((bContext *)C); +} + +static void metadata_panel_context_draw(const bContext *C, Panel *panel) { + SpaceClip *space_clip = CTX_wm_space_clip(C); + /* NOTE: This might not be exactly the same image buffer as shown in the + * clip editor itself, since that might be coming from proxy, or being + * postprocessed (stabilized or undistored). + * Ideally we need to query metadata from an original image or movie without + * reading actual pixels to speed up the process. */ + ImBuf *ibuf = ED_space_clip_get_buffer(space_clip); + if (ibuf != NULL) { + ED_region_image_metadata_panel_draw(ibuf, panel->layout); + IMB_freeImBuf(ibuf); + } +} +void ED_clip_buttons_register(ARegionType *art) +{ + PanelType *pt; + + pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel metadata"); + strcpy(pt->idname, "CLIP_PT_metadata"); + strcpy(pt->label, N_("Metadata")); + strcpy(pt->category, "Footage"); + strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); + pt->poll = metadata_panel_context_poll; + pt->draw = metadata_panel_context_draw; + BLI_addtail(&art->paneltypes, pt); } /********************* MovieClip Template ************************/ |