diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-02-05 16:51:51 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-02-05 16:51:51 +0400 |
commit | 1687023776a3ce0de41a4cfe0ebc72a5ebadabe4 (patch) | |
tree | 28e8af3d7cbafbab07bc86f61b58a109d0091408 /source/blender/editors/space_node | |
parent | e9fda259dac3d95018bc9378e2f8f3b10a8c46c4 (diff) |
Fix T38340 and T38473: fixed Scene pointers in Composite and Defocus nodes don't get updated based on context.
As discussed in T38340 the solution is to use the current scene from
context whenever feasible.
Composite does not use node->id at all now, the scene which owns the
compositing node tree is retrieved from context instead.
Defocus node->id is made editable by the user. By default it is not set,
which also will make it use the contextual scene and camera info.
The node->id pointer in Defocus is **not** cleared in older blend files.
This is done for backward compatibility: the node will then behave as
before in untouched scenes.
File Output nodes also don't store scene in node->id. This is only needed
when creating a new node for initializing the file format.
Reviewers: brecht, jbakker, mdewanchand
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D290
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 558fc160cf9..582e6861974 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1242,7 +1242,7 @@ static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *UNUSED( uiItemR(col, ptr, "sigma_space", 0, NULL, ICON_NONE); } -static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiLayout *sub, *col; @@ -1262,7 +1262,9 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po col = uiLayoutColumn(layout, FALSE); uiItemR(col, ptr, "use_preview", 0, NULL, ICON_NONE); - + + uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL); + col = uiLayoutColumn(layout, FALSE); uiItemR(col, ptr, "use_zbuffer", 0, NULL, ICON_NONE); sub = uiLayoutColumn(col, FALSE); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 7a12ed9ef08..9f76a9f1eb5 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -259,7 +259,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog // XXX BIF_store_spare(); /* 1 is do_previews */ - ntreeCompositExecTree(ntree, &cj->scene->r, FALSE, TRUE, &scene->view_settings, &scene->display_settings); + ntreeCompositExecTree(cj->scene, ntree, &cj->scene->r, FALSE, TRUE, &scene->view_settings, &scene->display_settings); ntree->test_break = NULL; ntree->stats_draw = NULL; |