Workaround for non-updating image editor when viewer node is opened there with view...
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Jun 2012 12:47:08 +0000 (12:47 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Jun 2012 12:47:08 +0000 (12:47 +0000)
source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
source/blender/imbuf/intern/divers.c

index a8aa84e84f912ed4bcde7673fe4b946b3628bb75..7466198a4c4d92fe9f694c9f5399199aaf2d0655 100644 (file)
@@ -71,7 +71,9 @@ void ViewerBaseOperation::initImage()
                imb_addrectfloatImBuf(ibuf);
                anImage->ok = IMA_OK_LOADED;
        }
-       
+
+       imb_freerectviewImBuf_all(ibuf);
+
        /* now we combine the input with ibuf */
        this->outputBuffer = ibuf->rect_float;
        this->outputBufferDisplay = (unsigned char *)ibuf->rect;
@@ -85,6 +87,10 @@ void ViewerBaseOperation:: updateImage(rcti *rect)
 
 void ViewerBaseOperation::deinitExecution()
 {
+       ImBuf *ibuf = BKE_image_acquire_ibuf(this->image, this->imageUser, &this->lock);
+       imb_freerectviewImBuf_all(ibuf);
+       BKE_image_release_ibuf(this->image, this->lock);
+
        this->outputBuffer = NULL;
 }
 
index 92e565e535c9c62e29d34446829d5c8a37f44f6e..a169d681adba7a8b1d6c1e401fbaf7baca51b9a3 100644 (file)
@@ -705,7 +705,7 @@ void IMB_rect_from_float_with_view_transform(ImBuf *ibuf, int view_transform)
                                                       ibuf->channels, ibuf->dither, predivide,
                                                       ibuf->x, ibuf->y, ibuf->x, ibuf->x);
        }
-       else {
+       else if (ibuf->x && ibuf->y) {
                ConstConfigRcPtr *config = OCIO_getCurrentConfig();
                ConstProcessorRcPtr *processor;
                DisplayTransformRcPtr *dt = OCIO_createDisplayTransform();