Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 6c0ab33dd2c..9162b8b76a9 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -279,8 +279,9 @@ static int space_image_main_area_not_uv_brush_poll(bContext *C)
Scene *scene = CTX_data_scene(C);
ToolSettings *toolsettings = scene->toolsettings;
- if (sima && !toolsettings->uvsculpt && !scene->obedit)
+ if (sima && !toolsettings->uvsculpt && (CTX_data_edit_object(C) == NULL)) {
return 1;
+ }
return 0;
}
@@ -814,7 +815,7 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
}
- else if (ED_space_image_check_show_maskedit(view_layer, sima)) {
+ else if (ED_space_image_check_show_maskedit(sima, view_layer)) {
if (!ED_mask_selected_minmax(C, min, max)) {
return OPERATOR_CANCELLED;
}
@@ -1857,7 +1858,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
/* we need renderresult for exr and rendered multiview */
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_mono = rr ? BLI_listbase_count_at_most(&rr->views, 2) < 2 : BLI_listbase_count_at_most(&ima->views, 2) < 2;
bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) && RE_HasFloatPixels(rr);
/* error handling */
@@ -2458,7 +2459,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
SpaceImage *sima_other = (SpaceImage *)sl;
if (!sima_other->pin) {
- ED_space_image_set(sima_other, scene, scene->obedit, ima);
+ ED_space_image_set(sima_other, scene, obedit, ima);
}
}
}
@@ -2623,8 +2624,7 @@ static int image_invert_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if (support_undo) {
- ED_undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name,
- ED_image_undo_restore, ED_image_undo_free, NULL);
+ ED_image_undo_push_begin(op->type->name);
/* not strictly needed, because we only imapaint_dirty_region to invalidate all tiles
* but better do this right in case someone copies this for a tool that uses partial redraw better */
ED_imapaint_clear_partial_redraw();
@@ -2665,8 +2665,9 @@ static int image_invert_exec(bContext *C, wmOperator *op)
if (ibuf->mipmap[0])
ibuf->userflags |= IB_MIPMAP_INVALID;
- if (support_undo)
- ED_undo_paint_push_end(UNDO_PAINT_IMAGE);
+ if (support_undo) {
+ ED_image_undo_push_end();
+ }
/* force GPU reupload, all image is invalid */
GPU_free_image(ima);