Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 24 Jan 2018 23:31:37 +0000 (10:31 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 24 Jan 2018 23:31:37 +0000 (10:31 +1100)
source/blender/blenkernel/BKE_library.h
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/space_image/image_ops.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c

index 0abf99415c75dc861cc2584bfd61d50c980648b9..f3df8b9b363cc9dfc20b9d26aef705a19f9b5977 100644 (file)
@@ -51,9 +51,9 @@ struct PointerRNA;
 struct PropertyRNA;
 
 size_t BKE_libblock_get_alloc_info(short type, const char **name);
-void *BKE_libblock_alloc_notest(short type);
-void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-void  BKE_libblock_init_empty(struct ID *id);
+void *BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT;
+void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+void  BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1);
 
 /**
  * New ID creation/copying options.
index 9dd51b289f4f0dd2880cef8082c217565956bc3d..0648bd804e01845861cb8a0e91e3a11c885e21b6 100644 (file)
@@ -109,6 +109,8 @@ typedef struct PaintStroke {
         * e.g. in sculpt mode, stroke doesn't start until cursor
         * passes over the mesh */
        bool stroke_started;
+       /* Set when enough motion was found for rake rotation */
+       bool rake_started;
        /* event that started stroke, for modal() return */
        int event_type;
        /* check if stroke variables have been initialized */
@@ -376,7 +378,12 @@ static bool paint_brush_update(bContext *C,
                else if (!(brush->flag & BRUSH_CURVE)) {
                        if (!paint_calculate_rake_rotation(ups, brush, mouse_init)) {
                                /* Not enough motion to define an angle. */
-                               is_dry_run = true;
+                               if(!stroke->rake_started) {
+                                       is_dry_run = true;
+                               }
+                       }
+                       else {
+                               stroke->rake_started = true;
                        }
                }
        }
index 2cc5c7f8d682f2c5e11c29bc8f0253c36fd45ea8..6c0ab33dd2c01274073f091c12a426811f1357ce 100644 (file)
@@ -1858,7 +1858,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
                scene = CTX_data_scene(C);
                rr = BKE_image_acquire_renderresult(scene, ima);
                bool is_mono = rr ? BLI_listbase_count_ex(&rr->views, 2) < 2 : BLI_listbase_count_ex(&ima->views, 2) < 2;
-               bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
+               bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) && RE_HasFloatPixels(rr);
 
                /* error handling */
                if (!rr) {
index a0f3a053618c2a88e328f7224f0635d3ddc150db..0557efccc2fa33c4b8dd029c2fbc2dbf22aaaf45 100644 (file)
@@ -392,6 +392,7 @@ void RE_updateRenderInstances(Render *re, int flag);
 /******* defined in render_result.c *********/
 
 bool RE_HasCombinedLayer(RenderResult *res);
+bool RE_HasFloatPixels(RenderResult *res);
 bool RE_RenderResult_is_stereo(RenderResult *res);
 struct RenderView *RE_RenderViewGetById(struct RenderResult *res, const int view_id);
 struct RenderView *RE_RenderViewGetByName(struct RenderResult *res, const char *viewname);
index ea3939cfd9991f43a686c50aaed7ac30f1dcf5fc..261d9e2e15964726ef0173ae50594217c3cf6b0c 100644 (file)
@@ -3395,7 +3395,8 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
                return false;
 
        bool is_mono = BLI_listbase_count_ex(&rr->views, 2) < 2;
-       bool is_exr_rr = ELEM(rd->im_format.imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
+       bool is_exr_rr = ELEM(rd->im_format.imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) &&
+                        RE_HasFloatPixels(rr);
 
        if (rd->im_format.views_format == R_IMF_VIEWS_MULTIVIEW && is_exr_rr)
        {
@@ -3413,14 +3414,11 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
                BLI_strncpy(filepath, name, sizeof(filepath));
 
                for (view_id = 0, rv = rr->views.first; rv; rv = rv->next, view_id++) {
-                       /* Sequencer and OpenGL render can't save multiple EXR layers. */
-                       bool is_float = rv->rect32 == NULL;
-
                        if (!is_mono) {
                                BKE_scene_multiview_view_filepath_get(&scene->r, filepath, rv->name, name);
                        }
 
-                       if (is_exr_rr && is_float) {
+                       if (is_exr_rr) {
                                ok = RE_WriteRenderResult(reports, rr, name, &rd->im_format, rv->name, -1);
                                render_print_save_message(reports, name, ok, errno);
 
index c250a91f4cbd53c3507e644292b2c8ff326da15b..10920545b88d535976b8f02a0ed1bf14b7951a4c 100644 (file)
@@ -1417,6 +1417,19 @@ bool RE_HasCombinedLayer(RenderResult *res)
        return (rv->rect32 || rv->rectf);
 }
 
+bool RE_HasFloatPixels(RenderResult *res)
+{
+       RenderView *rview;
+
+       for (rview = res->views.first; rview; rview = rview->next) {
+               if (rview->rect32 && !rview->rectf) {
+                       return false;
+               }
+       }
+
+       return true;
+}
+
 bool RE_RenderResult_is_stereo(RenderResult *res)
 {
        if (! BLI_findstring(&res->views, STEREO_LEFT_NAME, offsetof(RenderView, name)))