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>2012-05-22 18:13:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
commit53b01d90023a850b17ded5deb9cace354c8e298a (patch)
treeab8ce43ddf8046dc54e2cacc5ff46cbc5806910b /source/blender/nodes/intern
parent85923aff288da072750447b44e492ebe5c59bcce (diff)
A number of new features for the node editor in general and the Frame node in particular.
For an detailed user-level description of new features see the following blogpost: http://code.blender.org/index.php/2012/05/node-editing-tweaks/ TL;DR: * Frame node gets more usable bounding-box behavior * Node resizing has helpful mouse cursor indicators and works on all borders * Node selection/active colors are themeable independently * Customizable background colors for nodes (useful for frames visual distinction).
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/node_common.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 300954a3c19..21aad779f89 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -57,6 +57,7 @@
#include "MEM_guardedalloc.h"
#include "node_common.h"
+#include "node_util.h"
#include "node_exec.h"
#include "NOD_socket.h"
@@ -810,12 +811,24 @@ bNodeTemplate node_whileloop_template(bNode *node)
/**** FRAME ****/
+static void node_frame_init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
+{
+ NodeFrame *data = (NodeFrame *)MEM_callocN(sizeof(NodeFrame), "frame node storage");
+ node->storage = data;
+
+ data->flag |= NODE_FRAME_SHRINK;
+
+ data->label_size = 20;
+}
+
void register_node_type_frame(bNodeTreeType *ttype)
{
/* frame type is used for all tree types, needs dynamic allocation */
bNodeType *ntype= MEM_callocN(sizeof(bNodeType), "frame node type");
- node_type_base(ttype, ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND);
+ node_type_base(ttype, ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND|NODE_OPTIONS);
+ node_type_init(ntype, node_frame_init);
+ node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage);
node_type_size(ntype, 150, 100, 0);
node_type_compatibility(ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);