diff options
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 17 | ||||
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_image.c | 22 |
3 files changed, 17 insertions, 34 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 37b7b1cfd5f..3e035331838 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -329,15 +329,11 @@ void ED_node_shader_default(const bContext *C, ID *id) bNode *in, *out; bNodeSocket *fromsock, *tosock, *sock; bNodeTree *ntree; - PointerRNA ptr; int output_type, shader_type; float color[4] = { 0.0f, 0.0f, 0.0f, 1.0f }, strength = 1.0f; ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname); - RNA_id_pointer_create((ID *)ntree, &ptr); - RNA_boolean_set(&ptr, "is_local_tree", TRUE); - switch (GS(id->name)) { case ID_MA: { @@ -425,7 +421,6 @@ void ED_node_composit_default(const bContext *C, struct Scene *sce) { bNode *in, *out; bNodeSocket *fromsock, *tosock; - PointerRNA ptr; /* but lets check it anyway */ if (sce->nodetree) { @@ -436,9 +431,6 @@ void ED_node_composit_default(const bContext *C, struct Scene *sce) sce->nodetree = ntreeAddTree(NULL, "Compositing Nodetree", ntreeType_Composite->idname); - RNA_id_pointer_create((ID *)sce->nodetree, &ptr); - RNA_boolean_set(&ptr, "is_local_tree", TRUE); - sce->nodetree->chunksize = 256; sce->nodetree->edit_quality = NTREE_QUALITY_HIGH; sce->nodetree->render_quality = NTREE_QUALITY_HIGH; @@ -470,7 +462,6 @@ void ED_node_texture_default(const bContext *C, Tex *tx) { bNode *in, *out; bNodeSocket *fromsock, *tosock; - PointerRNA ptr; /* but lets check it anyway */ if (tx->nodetree) { @@ -481,9 +472,6 @@ void ED_node_texture_default(const bContext *C, Tex *tx) tx->nodetree = ntreeAddTree(NULL, "Texture Nodetree", ntreeType_Texture->idname); - RNA_id_pointer_create((ID *)tx->nodetree, &ptr); - RNA_boolean_set(&ptr, "is_local_tree", TRUE); - out = nodeAddStaticNode(C, tx->nodetree, TEX_NODE_OUTPUT); out->locx = 300.0f; out->locy = 300.0f; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 44ec8316c9d..9f42da0c702 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -6944,11 +6944,6 @@ static void rna_def_composite_nodetree(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Two Pass", "Use two pass execution during editing: first calculate fast nodes, " "second pass calculate all nodes"); - prop = RNA_def_property(srna, "is_local_tree", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_default(prop, FALSE); - RNA_def_property_flag(prop, PROP_IDPROPERTY); - RNA_def_property_ui_text(prop, "Local Scene Tree", "Local scene node tree, eligible for special node types"); - prop = RNA_def_property(srna, "use_viewer_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_VIEWER_BORDER); RNA_def_property_ui_text(prop, "Viewer Border", "Use boundaries for viewer nodes and composite backdrop"); @@ -6958,34 +6953,22 @@ static void rna_def_composite_nodetree(BlenderRNA *brna) static void rna_def_shader_nodetree(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop; srna = RNA_def_struct(brna, "ShaderNodeTree", "NodeTree"); RNA_def_struct_ui_text(srna, "Shader Node Tree", "Node tree consisting of linked nodes used for materials (and other shading datablocks)"); RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_ui_icon(srna, ICON_MATERIAL); - - prop = RNA_def_property(srna, "is_local_tree", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_default(prop, FALSE); - RNA_def_property_flag(prop, PROP_IDPROPERTY); - RNA_def_property_ui_text(prop, "Local Material Tree", "Local material node tree, eligible for special node types"); } static void rna_def_texture_nodetree(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop; srna = RNA_def_struct(brna, "TextureNodeTree", "NodeTree"); RNA_def_struct_ui_text(srna, "Texture Node Tree", "Node tree consisting of linked nodes used for textures"); RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_ui_icon(srna, ICON_TEXTURE); - - prop = RNA_def_property(srna, "is_local_tree", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_default(prop, FALSE); - RNA_def_property_flag(prop, PROP_IDPROPERTY); - RNA_def_property_ui_text(prop, "Local Texture Tree", "Local texture node tree, eligible for special node types"); } static void define_specific_node(BlenderRNA *brna, const char *struct_name, const char *base_name, 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) |