From aa40fcb0a72452a0a69c3b54b008678383a0119f Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 19 Mar 2013 18:15:33 +0000 Subject: Removed the is_local_tree property from compo/shader/texture node trees. This was using an ID property, which causes trouble with 2.62 builds (possibly later) due to an old bug that causes ID properties in local node trees not loaded correctly. The bug has been fixed since then, but creating id properties will break with these builds. The property was not really necessary, so removing it will make it work as long as users don't add id properties themselves. --- .../nodes/composite/nodes/node_composite_image.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'source/blender/nodes/composite') diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index aa218252472..c09903ad6c5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -31,6 +31,9 @@ #include "node_composite_util.h" +#include "BKE_global.h" +#include "BKE_main.h" + /* **************** IMAGE (and RenderResult, multilayer image) ******************** */ static bNodeSocketTemplate cmp_node_rlayers_out[] = { @@ -333,11 +336,20 @@ void register_node_type_cmp_image(void) static int node_composit_poll_rlayers(bNodeType *UNUSED(ntype), bNodeTree *ntree) { - PointerRNA ptr; - - /* render layers node can only be used in local scene->nodetree, since it directly links to the scene */ - RNA_id_pointer_create((ID *)ntree, &ptr); - return (strcmp(ntree->idname, "CompositorNodeTree")==0 && RNA_boolean_get(&ptr, "is_local_tree")); + if (strcmp(ntree->idname, "CompositorNodeTree")==0) { + Scene *scene; + + /* XXX ugly: check if ntree is a local scene node tree. + * Render layers node can only be used in local scene->nodetree, + * since it directly links to the scene. + */ + for (scene = G.main->scene.first; scene; scene = scene->id.next) + if (scene->nodetree == ntree) + break; + + return (scene != NULL); + } + return false; } void register_node_type_cmp_rlayers(void) -- cgit v1.2.3