diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-07-19 11:53:34 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-07-19 11:53:34 +0300 |
commit | 41cc366010e1d4b7b225e7c65df5a947bd5cbf70 (patch) | |
tree | b21e9359b2cd0eb8a30277ad5ee58f6a0a0eb4e0 /source/blender/editors/screen | |
parent | 794cbb27902b3b5f44bbdf05acf2b4fb13b33ab6 (diff) | |
parent | 95da68822ba92673e24b0fc70a44ac93d716a333 (diff) |
Merge branch 'master' into object_nodes
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 7 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 18 |
3 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index ab8b7d4e138..8d058ed2081 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -580,15 +580,20 @@ void ED_region_tag_refresh_ui(ARegion *ar) void ED_region_tag_redraw_partial(ARegion *ar, const rcti *rct) { if (ar && !(ar->do_draw & RGN_DRAWING)) { - if (!(ar->do_draw & RGN_DRAW)) { + if (!(ar->do_draw & (RGN_DRAW | RGN_DRAW_PARTIAL))) { /* no redraw set yet, set partial region */ ar->do_draw |= RGN_DRAW_PARTIAL; ar->drawrct = *rct; } else if (ar->drawrct.xmin != ar->drawrct.xmax) { + BLI_assert((ar->do_draw & RGN_DRAW_PARTIAL) != 0); /* partial redraw already set, expand region */ BLI_rcti_union(&ar->drawrct, rct); } + else { + BLI_assert((ar->do_draw & RGN_DRAW) != 0); + /* Else, full redraw is already requested, nothing to do here. */ + } } } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index a93c8c83cbb..f0a6b56a7d2 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -45,6 +45,7 @@ #include "BKE_image.h" #include "BKE_global.h" #include "BKE_library.h" +#include "BKE_library_remap.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_screen.h" @@ -1755,7 +1756,9 @@ bool ED_screen_delete_scene(bContext *C, Scene *scene) ED_screen_set_scene(C, CTX_wm_screen(C), newscene); - BKE_scene_unlink(bmain, scene, newscene); + BKE_libblock_remap(bmain, scene, newscene, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE); + + BKE_libblock_free(bmain, scene); return true; } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index f340f716ccb..6dbb5db53d0 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -168,7 +168,7 @@ int ED_operator_screen_mainwinactive(bContext *C) int ED_operator_scene_editable(bContext *C) { Scene *scene = CTX_data_scene(C); - if (scene && scene->id.lib == NULL) + if (scene && !ID_IS_LINKED_DATABLOCK(scene)) return 1; return 0; } @@ -178,7 +178,7 @@ int ED_operator_objectmode(bContext *C) Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); - if (scene == NULL || scene->id.lib) + if (scene == NULL || ID_IS_LINKED_DATABLOCK(scene)) return 0; if (CTX_data_edit_object(C)) return 0; @@ -279,7 +279,7 @@ int ED_operator_node_editable(bContext *C) { SpaceNode *snode = CTX_wm_space_node(C); - if (snode && snode->edittree && snode->edittree->id.lib == NULL) + if (snode && snode->edittree && !ID_IS_LINKED_DATABLOCK(snode->edittree)) return 1; return 0; @@ -341,20 +341,20 @@ int ED_operator_object_active(bContext *C) int ED_operator_object_active_editable(bContext *C) { Object *ob = ED_object_active_context(C); - return ((ob != NULL) && !(ob->id.lib) && !ed_object_hidden(ob)); + return ((ob != NULL) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob)); } int ED_operator_object_active_editable_mesh(bContext *C) { Object *ob = ED_object_active_context(C); - return ((ob != NULL) && !(ob->id.lib) && !ed_object_hidden(ob) && - (ob->type == OB_MESH) && !(((ID *)ob->data)->lib)); + return ((ob != NULL) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob) && + (ob->type == OB_MESH) && !ID_IS_LINKED_DATABLOCK(ob->data)); } int ED_operator_object_active_editable_font(bContext *C) { Object *ob = ED_object_active_context(C); - return ((ob != NULL) && !(ob->id.lib) && !ed_object_hidden(ob) && + return ((ob != NULL) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob) && (ob->type == OB_FONT)); } @@ -2479,7 +2479,7 @@ static void SCREEN_OT_screen_full_area(wmOperatorType *ot) { PropertyRNA *prop; - ot->name = "Toggle Fullscreen Area"; + ot->name = "Toggle Maximize Area"; ot->description = "Toggle display selected area as fullscreen/maximized"; ot->idname = "SCREEN_OT_screen_full_area"; @@ -3955,7 +3955,7 @@ static int scene_new_exec(bContext *C, wmOperator *op) newscene = BKE_scene_add(bmain, DATA_("Scene")); } else { /* different kinds of copying */ - newscene = BKE_scene_copy(scene, type); + newscene = BKE_scene_copy(bmain, scene, type); /* these can't be handled in blenkernel currently, so do them here */ if (type == SCE_COPY_LINK_DATA) { |