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:
authorTon Roosendaal <ton@blender.org>2005-12-21 17:24:51 +0300
committerTon Roosendaal <ton@blender.org>2005-12-21 17:24:51 +0300
commitce52827a0574f3c9b7054b2ddde5c8df3a9c646d (patch)
treed6f98dadc8e1c859e717e86d7bed28a47420d86a /source/blender/makesdna
parentb33c68c906ffd6b3c5bb8c629d961037fe8c9254 (diff)
Orange; daily noodler update commit.
- Adding execution code for Node trees. Was a bit a puzzle, since I want it to be multithreading by design. This now is solved by defining a stack per tree for all data that's being written into. This stack, which resides now in the NodeTree itself, then can be allocated per thread. - For testing pleasure, I've added a 'mix node' and a 'show node', so you can already see it do something. :) - reshuffled structure, to put things nice together, and have easier node adding. Current state is still WIP though, structure might change. For the record; new file node_shaders.c will contain all shader node definitions, apart from the drawing callbacks. Next: I'm going to check on Andrea's work on icons now, since this is very much needed for true shader/composit work. Now back to release work...
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 30bfc22ca4a..db118d706b3 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -35,6 +35,7 @@
struct ID;
struct SpaceNode;
+struct bNodeLink;
#define NODE_MAXSTR 32
@@ -42,10 +43,10 @@ typedef struct bNodeSocket {
struct bNodeSocket *next, *prev;
char name[32];
- short type, flag, limit, pad;
+ short type, flag, limit, stack_index;
float locx, locy;
- ListBase links; /* now only used temporal for sorting */
+ struct bNodeLink *link; /* input link to parent, max one! */
} bNodeSocket;
@@ -57,6 +58,10 @@ typedef struct bNodeSocket {
/* sock->flag, first bit is select */
+typedef struct bNodeStack {
+ float vec[4];
+ void *data;
+} bNodeStack;
/* limit data in bNode to what we want to see saved? */
typedef struct bNode {
@@ -67,16 +72,15 @@ typedef struct bNode {
ListBase inputs, outputs;
struct ID *id; /* optional link to libdata */
- void *data; /* custom data */
- float vec[4]; /* builtin custom data */
+ bNodeStack ns; /* builtin data, for UI to write into */
float locx, locy; /* root offset for drawing */
float width, prv_h;
rctf tot; /* entire boundbox */
rctf prv; /* optional preview area */
- int (*drawfunc)(struct SpaceNode *, struct bNode *);
- int (*execfunc)(struct bNode *);
+ void (*drawfunc)(struct SpaceNode *, struct bNode *);
+ void (*execfunc)(struct bNode *, struct bNodeStack **);
} bNode;
@@ -96,9 +100,20 @@ typedef struct bNodeTree {
ListBase nodes, links;
ListBase inputs, outputs; /* default inputs and outputs, for solving tree */
+ bNodeStack *stack;
+
+ int type, init;
} bNodeTree;
+/* ntree->type, index */
+#define NTREE_SHADER 0
+#define NTREE_COMPOSIT 1
+
+/* ntree->init, flag */
+#define NTREE_EXEC_SET 1
+#define NTREE_DRAW_SET 2
+
#endif