diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-05 16:23:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-05 16:25:36 +0300 |
commit | e1b5fe156db2871ae0eb32d0af3e1c5fb8a7507a (patch) | |
tree | 09f7f5757822c0b7dabf7c94380e8303a9aad4b9 /source/blender/blenkernel | |
parent | 56f5fd84fc0c614b2c1e3e7f22b289504496426a (diff) |
Support showing metadata for multilayer EXR files
Quite straightforward: first, convert metadata from file to
stamp data which is stored in the render result, and then
for every requested layer/pass use that as a metadata.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 971b79ed20d..d21e1cc7986 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2180,6 +2180,9 @@ void BKE_imbuf_stamp_info(RenderResult *rr, struct ImBuf *ibuf) void BKE_stamp_info_from_imbuf(RenderResult *rr, struct ImBuf *ibuf) { + if (rr->stamp_data == NULL) { + rr->stamp_data = MEM_callocN(sizeof(StampData), "RenderResult.stamp_data"); + } struct StampData *stamp_data = rr->stamp_data; IMB_metadata_ensure(&ibuf->metadata); BKE_stamp_info_callback(ibuf, stamp_data, metadata_get_field, true); @@ -3073,8 +3076,10 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr) IMB_exr_close(ibuf->userdata); ibuf->userdata = NULL; - if (ima->rr) + if (ima->rr != NULL) { ima->rr->framenr = framenr; + BKE_stamp_info_from_imbuf(ima->rr, ibuf); + } /* set proper views */ image_init_multilayer_multiview(ima, ima->rr); @@ -3275,6 +3280,8 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f ibuf->mall = IB_rectfloat; ibuf->channels = rpass->channels; + BKE_imbuf_stamp_info(ima->rr, ibuf); + image_initialize_after_load(ima, ibuf); image_assign_ibuf(ima, ibuf, iuser ? iuser->multi_index : 0, frame); @@ -3586,6 +3593,8 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser) ibuf->flags |= IB_rectfloat; ibuf->channels = rpass->channels; + BKE_imbuf_stamp_info(ima->rr, ibuf); + image_assign_ibuf(ima, ibuf, iuser ? iuser->multi_index : IMA_NO_INDEX, 0); } } |