[Bf-blender-cvs] [b3685a8] multiview: Image Editor saving of image in 3d (individual views) working
Dalai Felinto
noreply at git.blender.org
Tue Sep 9 23:00:37 CEST 2014
Commit: b3685a8ea3440e1ff3474268c327841a7ab3d9ff
Author: Dalai Felinto
Date: Tue Sep 9 22:54:10 2014 +0200
Branches: multiview
https://developer.blender.org/rBb3685a8ea3440e1ff3474268c327841a7ab3d9ff
Image Editor saving of image in 3d (individual views) working
Note: I need to go over this function again to see if I'm handling the
'save as copy' == false correctly. If the image is saved to a
destructive format, in that case we should change the current image (and
I'm almost sure I overlooked that).
This function can likely be simplified as well now that I'm more
comfortable with the whole image pipeline.
===================================================================
M source/blender/editors/space_image/image_ops.c
===================================================================
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 717f7ab..78106c9 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1814,36 +1814,43 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
/* individual multiview images */
else if (simopts->im_format.views_format == R_IMF_VIEWS_INDIVIDUAL){
- RenderView *rv;
size_t i;
unsigned char planes = ibuf->planes;
+ const size_t totviews = (rr ? BLI_countlist(&rr->views) : BLI_countlist(&ima->views));
if (!is_multilayer) {
ED_space_image_release_buffer(sima, ibuf, lock);
}
- for (i = 0, rv = (RenderView *) rr->views.first; rv; rv = rv->next, i++) {
+ for (i = 0; i < totviews; i++) {
char filepath[FILE_MAX];
bool ok_view = false;
+ const char *view = rr ? ((RenderView *) BLI_findlink(&rr->views, i))->name:
+ ((ImageView *) BLI_findlink(&ima->views, i))->name;
if (is_multilayer) {
- BKE_scene_view_get_filepath(scene, simopts->filepath, rv->name, filepath);
- ok_view = RE_WriteRenderResult(op->reports, rr, filepath, imf, false, rv->name);
+ BKE_scene_view_get_filepath(scene, simopts->filepath, view, filepath);
+ ok_view = RE_WriteRenderResult(op->reports, rr, filepath, imf, false, view);
save_image_post(op, ibuf, ima, ok_view, true, relbase, relative, do_newpath, filepath);
}
else {
/* copy iuser to get the correct ibuf for this view */
ImageUser iuser = sima->iuser;
- iuser.pass = get_multiview_pass_id(rr, &sima->iuser, i);
iuser.view = i;
iuser.flag &= ~IMA_SHOW_STEREO;
- /* get the proper ibuf for this view */
- BKE_image_multilayer_index(rr, &iuser);
+ if (rr) {
+ iuser.pass = get_multiview_pass_id(rr, &sima->iuser, i);
+ BKE_image_multilayer_index(rr, &iuser);
+ }
+ else {
+ BKE_image_multiview_index(ima, &iuser);
+ }
+
ibuf = BKE_image_acquire_ibuf(sima->image, &iuser, &lock);
ibuf->planes = planes;
- BKE_scene_view_get_filepath(scene, simopts->filepath, rv->name, filepath);
+ BKE_scene_view_get_filepath(scene, simopts->filepath, view, filepath);
IMB_colormanagement_imbuf_for_write(ibuf, save_as_render, false, &imf->view_settings, &imf->display_settings, imf);
ok_view = BKE_imbuf_write_as(ibuf, filepath, &simopts->im_format, save_copy);
More information about the Bf-blender-cvs
mailing list