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:
authorJulian Eisel <eiseljulian@gmail.com>2017-11-16 01:52:16 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-11-16 01:52:16 +0300
commitf25f7fd9f1a651485041b1e60d55c51784075053 (patch)
tree6d767ce978034bd54ce14ca1688db409ebe9458a /source/blender/editors/screen
parent145077bea75414daea1d338853199d3b5fe8336e (diff)
parentae8130e28740ec2d985f1e54312eeba6527f81cc (diff)
Merge branch 'blender2.8' into topbar
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_edit.c15
-rw-r--r--source/blender/editors/screen/screen_ops.c26
-rw-r--r--source/blender/editors/screen/workspace_edit.c6
3 files changed, 25 insertions, 22 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 92d7f088eb4..d735b64241d 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -45,6 +45,7 @@
#include "BKE_icons.h"
#include "BKE_image.h"
#include "BKE_global.h"
+#include "BKE_layer.h"
#include "BKE_library.h"
#include "BKE_library_remap.h"
#include "BKE_main.h"
@@ -1240,13 +1241,13 @@ bool ED_screen_change(bContext *C, bScreen *sc)
return false;
}
-static void screen_set_3dview_camera(Scene *scene, ScrArea *sa, View3D *v3d)
+static void screen_set_3dview_camera(Scene *scene, SceneLayer *scene_layer, ScrArea *sa, View3D *v3d)
{
/* fix any cameras that are used in the 3d view but not in the scene */
BKE_screen_view3d_sync(v3d, scene);
- if (!v3d->camera || !BKE_scene_base_find(scene, v3d->camera)) {
- v3d->camera = BKE_scene_camera_find(scene);
+ if (!v3d->camera || !BKE_scene_layer_base_find(scene_layer, v3d->camera)) {
+ v3d->camera = BKE_scene_layer_camera_find(scene_layer);
// XXX if (sc == curscreen) handle_view3d_lock();
if (!v3d->camera) {
ARegion *ar;
@@ -1270,13 +1271,13 @@ static void screen_set_3dview_camera(Scene *scene, ScrArea *sa, View3D *v3d)
}
}
-void ED_screen_update_after_scene_change(const bScreen *screen, Scene *scene_new)
+void ED_screen_update_after_scene_change(const bScreen *screen, Scene *scene_new, SceneLayer *scene_layer)
{
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
- screen_set_3dview_camera(scene_new, sa, v3d);
+ screen_set_3dview_camera(scene_new, scene_layer, sa, v3d);
}
}
}
@@ -1632,7 +1633,7 @@ void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh)
}
/* results in fully updated anim system */
-void ED_update_for_newframe(Main *bmain, Scene *scene)
+void ED_update_for_newframe(Main *bmain, Scene *scene, SceneLayer *scene_layer, struct Depsgraph *depsgraph)
{
#ifdef DURIAN_CAMERA_SWITCH
void *camera = BKE_scene_camera_switch_find(scene);
@@ -1649,7 +1650,7 @@ void ED_update_for_newframe(Main *bmain, Scene *scene)
ED_clip_update_frame(bmain, scene->r.cfra);
/* this function applies the changes too */
- BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene);
+ BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer);
/* composite */
if (scene->use_nodes && scene->nodetree)
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 338e40523bd..339a6d65ffc 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -171,7 +171,7 @@ int ED_operator_screen_mainwinactive(bContext *C)
int ED_operator_scene_editable(bContext *C)
{
Scene *scene = CTX_data_scene(C);
- if (scene && !ID_IS_LINKED_DATABLOCK(scene))
+ if (scene && !ID_IS_LINKED(scene))
return 1;
return 0;
}
@@ -181,7 +181,7 @@ int ED_operator_objectmode(bContext *C)
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
- if (scene == NULL || ID_IS_LINKED_DATABLOCK(scene))
+ if (scene == NULL || ID_IS_LINKED(scene))
return 0;
if (CTX_data_edit_object(C))
return 0;
@@ -282,7 +282,7 @@ int ED_operator_node_editable(bContext *C)
{
SpaceNode *snode = CTX_wm_space_node(C);
- if (snode && snode->edittree && !ID_IS_LINKED_DATABLOCK(snode->edittree))
+ if (snode && snode->edittree && !ID_IS_LINKED(snode->edittree))
return 1;
return 0;
@@ -344,20 +344,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) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob));
+ return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob));
}
int ED_operator_object_active_editable_mesh(bContext *C)
{
Object *ob = ED_object_active_context(C);
- return ((ob != NULL) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob) &&
- (ob->type == OB_MESH) && !ID_IS_LINKED_DATABLOCK(ob->data));
+ return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob) &&
+ (ob->type == OB_MESH) && !ID_IS_LINKED(ob->data));
}
int ED_operator_object_active_editable_font(bContext *C)
{
Object *ob = ED_object_active_context(C);
- return ((ob != NULL) && !ID_IS_LINKED_DATABLOCK(ob) && !ed_object_hidden(ob) &&
+ return ((ob != NULL) && !ID_IS_LINKED(ob) && !ed_object_hidden(ob) &&
(ob->type == OB_FONT));
}
@@ -450,8 +450,8 @@ int ED_operator_posemode_local(bContext *C)
if (ED_operator_posemode(C)) {
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
bArmature *arm = ob->data;
- return !(ID_IS_LINKED_DATABLOCK(&ob->id) ||
- ID_IS_LINKED_DATABLOCK(&arm->id));
+ return !(ID_IS_LINKED(&ob->id) ||
+ ID_IS_LINKED(&arm->id));
}
return false;
}
@@ -2805,12 +2805,12 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent
pup = UI_popup_menu_begin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
layout = UI_popup_menu_layout(pup);
- ptr = uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr);
/* store initial mouse cursor position */
RNA_int_set(&ptr, "mouse_x", event->x);
RNA_int_set(&ptr, "mouse_y", event->y);
- ptr = uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr);
/* mouse cursor on edge, '4' can fail on wide edges... */
RNA_int_set(&ptr, "min_x", event->x + 4);
RNA_int_set(&ptr, "min_y", event->y + 4);
@@ -3429,6 +3429,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
if (screen->animtimer && screen->animtimer == event->customdata) {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
+ SceneLayer *scene_layer = CTX_data_scene_layer(C);
+ struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
wmTimer *wt = screen->animtimer;
ScreenAnimData *sad = wt->customdata;
wmWindowManager *wm = CTX_wm_manager(C);
@@ -3539,7 +3541,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
}
/* since we follow drawflags, we can't send notifier but tag regions ourselves */
- ED_update_for_newframe(bmain, scene);
+ ED_update_for_newframe(bmain, scene, scene_layer, depsgraph);
for (window = wm->windows.first; window; window = window->next) {
const bScreen *win_screen = WM_window_get_active_screen(window);
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index 2229ecce408..4d1b89634e3 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -379,9 +379,9 @@ static void workspace_append_button(
lib_path, sizeof(lib_path), from_main->name, BKE_idcode_to_name(GS(id->name)), NULL);
BLI_assert(STREQ(ot_append->idname, "WM_OT_append"));
- opptr = uiItemFullO_ptr(
- layout, ot_append, workspace->id.name + 2, ICON_NONE, NULL,
- WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ uiItemFullO_ptr(
+ layout, ot_append, workspace->id.name + 2, ICON_NONE, NULL,
+ WM_OP_EXEC_DEFAULT, 0, &opptr);
RNA_string_set(&opptr, "directory", lib_path);
RNA_string_set(&opptr, "filename", id->name + 2);
}