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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-03-19 14:42:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-03-19 14:42:33 +0400
commit0f3515d4e2cdb4df68540e1dfd74b1dc9e1e821e (patch)
treea06011e46a85e08357dbee01f16a0868e5669480 /source/blender/editors/space_node/node_edit.c
parent4857d62ac6fa0c11def1a16b3f13a5a505e23ca3 (diff)
Fixes for context updates of the node editor:
* If the node tree can be updated from context (tree has get_from_context callback defined), reset the pointers first to clear the editor path if no tree can be found. * Stupid mistake: snode->from != snode->from is always false. * Shader nodes context update: set the 'from' pointer to the active object, even if it doesn't have a material or node tree.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r--source/blender/editors/space_node/node_edit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 256b02d3288..37b7b1cfd5f 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -530,11 +530,17 @@ void snode_set_context(const bContext *C)
}
if (!(snode->flag & SNODE_PIN) || ntree == NULL) {
- if (treetype->get_from_context)
+ if (treetype->get_from_context) {
+ /* reset and update from context */
+ ntree = NULL;
+ id = NULL;
+ from = NULL;
+
treetype->get_from_context(C, treetype, &ntree, &id, &from);
+ }
}
- if (snode->nodetree != ntree || snode->id != id || snode->from != snode->from) {
+ if (snode->nodetree != ntree || snode->id != id || snode->from != from) {
ED_node_tree_start(snode, ntree, id, from);
}
}