diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-13 04:05:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-13 04:05:49 +0300 |
commit | cdc31c3e6e953b8e10c757db113b7a60f701e1dd (patch) | |
tree | 6bb85293faf6b7ab7ad7e8d169106584590fbc94 /source/blender/imbuf/intern | |
parent | 49d51a1e6246f00233abf54a8b24b5d829848e44 (diff) | |
parent | 40dbf2fc0000f2905d436fc28b93a9b97431f72d (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 50 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_multi.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_stub.cpp | 2 |
3 files changed, 29 insertions, 25 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index ca534e3e2a8..2fa830dc42a 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1059,11 +1059,11 @@ void IMB_exr_write_channels(void *handle) /* temporary function, used for FSA and Save Buffers */ /* called once per tile * view */ -void IMB_exrtile_write_channels(void *handle, int partx, int party, int level, const char *viewname) +void IMB_exrtile_write_channels(void *handle, int partx, int party, int level, const char *viewname, bool empty) { + /* Can write empty channels for incomplete renders. */ ExrHandle *data = (ExrHandle *)handle; FrameBuffer frameBuffer; - ExrChannel *echan; std::string view(viewname); const int view_id = imb_exr_get_multiView_id(*data->multiView, view); @@ -1071,28 +1071,32 @@ void IMB_exrtile_write_channels(void *handle, int partx, int party, int level, c exr_printf("%s %-6s %-22s \"%s\"\n", "p", "view", "name", "internal_name"); exr_printf("---------------------------------------------------------------------\n"); - for (echan = (ExrChannel *)data->channels.first; echan; echan = echan->next) { + if (!empty) { + ExrChannel *echan; + + for (echan = (ExrChannel *)data->channels.first; echan; echan = echan->next) { + + /* eventually we can make the parts' channels to include + only the current view TODO */ + if (strcmp(viewname, echan->m->view.c_str()) != 0) + continue; - /* eventually we can make the parts' channels to include - only the current view TODO */ - if (strcmp(viewname, echan->m->view.c_str()) != 0) - continue; - - exr_printf("%d %-6s %-22s \"%s\"\n", - echan->m->part_number, - echan->m->view.c_str(), - echan->m->name.c_str(), - echan->m->internal_name.c_str() - ); - - float *rect = echan->rect - echan->xstride * partx - echan->ystride * party; - frameBuffer.insert(echan->m->internal_name, - Slice(Imf::FLOAT, - (char *)rect, - echan->xstride * sizeof(float), - echan->ystride * sizeof(float) - ) - ); + exr_printf("%d %-6s %-22s \"%s\"\n", + echan->m->part_number, + echan->m->view.c_str(), + echan->m->name.c_str(), + echan->m->internal_name.c_str() + ); + + float *rect = echan->rect - echan->xstride * partx - echan->ystride * party; + frameBuffer.insert(echan->m->internal_name, + Slice(Imf::FLOAT, + (char *)rect, + echan->xstride * sizeof(float), + echan->ystride * sizeof(float) + ) + ); + } } TiledOutputPart out (*data->mpofile, view_id); diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h index d9517d13cc4..d9338c888a7 100644 --- a/source/blender/imbuf/intern/openexr/openexr_multi.h +++ b/source/blender/imbuf/intern/openexr/openexr_multi.h @@ -67,7 +67,7 @@ float *IMB_exr_channel_rect(void *handle, const char *layname, const char *pass void IMB_exr_read_channels(void *handle); void IMB_exr_write_channels(void *handle); -void IMB_exrtile_write_channels(void *handle, int partx, int party, int level, const char *viewname); +void IMB_exrtile_write_channels(void *handle, int partx, int party, int level, const char *viewname, bool empty); void IMB_exr_clear_channels(void *handle); void IMB_exr_multilayer_convert( diff --git a/source/blender/imbuf/intern/openexr/openexr_stub.cpp b/source/blender/imbuf/intern/openexr/openexr_stub.cpp index 05fddcb5fa5..301e827d739 100644 --- a/source/blender/imbuf/intern/openexr/openexr_stub.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_stub.cpp @@ -47,7 +47,7 @@ float *IMB_exr_channel_rect (void * /*handle*/, const char * /*layname*/ void IMB_exr_read_channels (void * /*handle*/) { } void IMB_exr_write_channels (void * /*handle*/) { } -void IMB_exrtile_write_channels (void * /*handle*/, int /*partx*/, int /*party*/, int /*level*/, const char * /*viewname*/) { } +void IMB_exrtile_write_channels (void * /*handle*/, int /*partx*/, int /*party*/, int /*level*/, const char * /*viewname*/, bool /*empty*/) { } void IMB_exr_clear_channels (void * /*handle*/) { } void IMB_exr_multilayer_convert( |