Mango request: option to create nodes with hidden preview by default
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 30 Jul 2012 17:11:59 +0000 (17:11 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 30 Jul 2012 17:11:59 +0000 (17:11 +0000)
release/scripts/startup/bl_ui/space_node.py
source/blender/editors/space_node/node_edit.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

index 961ab08efdd406d81f99693dc4fb51f1cf63da27..40fe9be91357c67dc068888798946a1a3879f366 100644 (file)
@@ -236,6 +236,7 @@ class NODE_PT_quality(bpy.types.Panel):
         layout.prop(tree, "use_opencl")
         layout.prop(tree, "two_pass")
         layout.prop(snode, "show_highlight")
+        layout.prop(snode, "use_hidden_preview")
   
 
 class NODE_MT_node_color_presets(Menu):
index c04bcdac142b9480bd306e0de2b928e9ae9763cf..b3ef4561b729d69a10e7eea52b61187f124962b1 100644 (file)
@@ -2589,6 +2589,10 @@ bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene, bNodeTemplate
                if (node->id)
                        id_us_plus(node->id);
                        
+
+               if (snode->flag & SNODE_USE_HIDDEN_PREVIEW)
+                       node->flag &= ~NODE_PREVIEW;
+
                snode_update(snode, node);
        }
        
index ca2917cb03b485af095fd998f309541357680915..b9603e2cdb11cd0a5cf9e4e969da539da4245525 100644 (file)
@@ -903,6 +903,7 @@ typedef enum eSpaceNode_Flag {
        SNODE_SHOW_B         = (1 << 9),
        SNODE_AUTO_RENDER    = (1 << 5),
        SNODE_SHOW_HIGHLIGHT = (1 << 6),
+       SNODE_USE_HIDDEN_PREVIEW = (1 << 10),
 } eSpaceNode_Flag;
 
 /* snode->texfrom */
index 74780faa700de949c78b89743ff3899be98751a6..74f6b16a111b4960a9b4d000eaaf89163ab83a2a 100644 (file)
@@ -2989,6 +2989,11 @@ static void rna_def_space_node(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_SHOW_HIGHLIGHT);
        RNA_def_property_ui_text(prop, "Highlight", "Highlight nodes that are being calculated");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
+
+       prop = RNA_def_property(srna, "use_hidden_preview", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_USE_HIDDEN_PREVIEW);
+       RNA_def_property_ui_text(prop, "Hide Preview", "Hide preview for newly creating nodes");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
 }
 
 static void rna_def_space_logic(BlenderRNA *brna)