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>2011-02-08 12:02:16 +0300
committerLukas Toenne <lukas.toenne@googlemail.com>2011-02-08 12:02:16 +0300
commit803c7fb4d49b51de750751a5707ebc57c653b959 (patch)
tree0d5fcdf6935c328dcf84f7b9f9851c4fa4370bfc /source/blender/nodes/intern/TEX_nodes
parent914e2ee01f35edc60ffa20d84a198c757cfa31da (diff)
Finished the node type definition cleanup started in r34682. All static node types should now use the node_type_* definition helpers to initialize their bNodeType structs.
Diffstat (limited to 'source/blender/nodes/intern/TEX_nodes')
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_at.c26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_bricks.c27
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_checker.c26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_compose.c26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_coord.c29
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_curves.c58
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_decompose.c26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_distance.c30
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_image.c30
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_invert.c27
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_math.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_output.c30
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_proc.c36
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_rotate.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_scale.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_texture.c27
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_translate.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c28
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c56
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_viewer.c26
22 files changed, 279 insertions, 395 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c
index 1ca293acb5b..75fa1e4378d 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_at.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c
@@ -53,20 +53,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_at = {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_AT,
- /* name */ "At",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_DISTORT, 0,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_at(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_AT, "At", NODE_CLASS_DISTORT, 0,
+ inputs, outputs);
+ node_type_size(&ntype, 140, 100, 320);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
index 9d26621e08c..7a32b6342aa 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
@@ -112,20 +112,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_bricks= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_BRICKS,
- /* name */ "Bricks",
- /* width+range */ 150, 60, 150,
- /* class+opts */ NODE_CLASS_PATTERN, NODE_OPTIONS | NODE_PREVIEW,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ init,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_bricks(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 150, 60, 150);
+ node_type_init(&ntype, init);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
index 64b70455a19..25cfd4412f5 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
@@ -64,20 +64,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_checker= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_CHECKER,
- /* name */ "Checker",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_PATTERN, NODE_OPTIONS | NODE_PREVIEW,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_checker(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 100, 60, 150);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
index f05e1e987da..3b933927c5e 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
@@ -52,20 +52,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_compose= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_COMPOSE,
- /* name */ "Compose RGBA",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_OP_COLOR, 0,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_compose(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_COMPOSE, "Compose RGBA", NODE_CLASS_OP_COLOR, 0,
+ inputs, outputs);
+ node_type_size(&ntype, 100, 60, 150);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
index 4ad32bc872e..5311dbc2360 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
@@ -45,20 +45,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &vectorfn, data);
}
-bNodeType tex_node_coord= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_COORD,
- /* name */ "Coordinates",
- /* width+range */ 120, 110, 160,
- /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS,
- /* input sock */ NULL,
- /* output sock */ outputs,
- /* storage */ "node_coord",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
+void register_node_type_tex_coord(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT, NODE_OPTIONS,
+ NULL, outputs);
+ node_type_size(&ntype, 120, 110, 160);
+ node_type_storage(&ntype, "node_coord", NULL, NULL);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
index 0fca0aa30ad..e4ea39b8591 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
@@ -61,22 +61,19 @@ static void time_init(bNode* node)
node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
}
-bNodeType tex_node_curve_time= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_CURVE_TIME,
- /* name */ "Time",
- /* width+range */ 140, 100, 320,
- /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS,
- /* input sock */ NULL,
- /* output sock */ time_outputs,
- /* storage */ "CurveMapping",
- /* execfunc */ time_exec,
- /* butfunc */ NULL,
- /* initfunc */ time_init,
- /* freestoragefunc */ node_free_curves,
- /* copystoragefunc */ node_copy_curves,
- /* id */ NULL
-};
+void register_node_type_tex_curve_time(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_CURVE_TIME, "Time", NODE_CLASS_INPUT, NODE_OPTIONS,
+ NULL, time_outputs);
+ node_type_size(&ntype, 140, 100, 320);
+ node_type_init(&ntype, time_init);
+ node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
+ node_type_exec(&ntype, time_exec);
+
+ nodeRegisterType(lb, &ntype);
+}
/* **************** CURVE RGB ******************** */
static bNodeSocketType rgb_inputs[]= {
@@ -108,20 +105,17 @@ static void rgb_init(bNode *node)
node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
}
-bNodeType tex_node_curve_rgb= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_CURVE_RGB,
- /* name */ "RGB Curves",
- /* width+range */ 200, 140, 320,
- /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
- /* input sock */ rgb_inputs,
- /* output sock */ rgb_outputs,
- /* storage */ "CurveMapping",
- /* execfunc */ rgb_exec,
- /* butfunc */ NULL,
- /* initfunc */ rgb_init,
- /* freestoragefunc */ node_free_curves,
- /* copystoragefunc */ node_copy_curves,
- /* id */ NULL
-};
+void register_node_type_tex_curve_rgb(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+ rgb_inputs, rgb_outputs);
+ node_type_size(&ntype, 200, 140, 320);
+ node_type_init(&ntype, rgb_init);
+ node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
+ node_type_exec(&ntype, rgb_exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
index 13768aaa868..c66e26321b6 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
@@ -73,20 +73,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[3], &valuefn_a, data);
}
-bNodeType tex_node_decompose= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_DECOMPOSE,
- /* name */ "Decompose RGBA",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_OP_COLOR, 0,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_decompose(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_DECOMPOSE, "Decompose RGBA", NODE_CLASS_OP_COLOR, 0,
+ inputs, outputs);
+ node_type_size(&ntype, 100, 60, 150);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
index 5d624205f43..887fbd1be90 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
@@ -56,21 +56,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &valuefn, data);
}
-bNodeType tex_node_distance= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_DISTANCE,
- /* name */ "Distance",
- /* width+range */ 120, 110, 160,
- /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "node_distance",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
-
+void register_node_type_tex_distance(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_DISTANCE, "Distance", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 120, 110, 160);
+ node_type_storage(&ntype, "node_distance", NULL, NULL);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
index 2ccde083823..66a98b70fd4 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
@@ -87,22 +87,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_hue_sat= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_HUE_SAT,
- /* name */ "Hue Saturation Value",
- /* width+range */ 150, 80, 250,
- /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_hue_sat(ListBase *lb)
+{
+ static bNodeType ntype;
-};
-
-
+ node_type_base(&ntype, TEX_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 150, 80, 250);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
index 7c680b4c25a..a870d1d31fe 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
@@ -91,20 +91,16 @@ static void init(bNode* node)
iuser->ok= 1;
}
-bNodeType tex_node_image= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_IMAGE,
- /* name */ "Image",
- /* width+range */ 120, 80, 300,
- /* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
- /* input sock */ NULL,
- /* output sock */ outputs,
- /* storage */ "ImageUser",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ init,
- /* freestoragefunc */ node_free_standard_storage,
- /* copystoragefunc */ node_copy_standard_storage,
- /* id */ NULL
-};
-
+void register_node_type_tex_image(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
+ NULL, outputs);
+ node_type_size(&ntype, 120, 80, 300);
+ node_type_init(&ntype, init);
+ node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
index 421082aeb34..d6d66abd863 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
@@ -58,20 +58,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_invert= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_INVERT,
- /* name */ "Invert",
- /* width+range */ 90, 80, 100,
- /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
+void register_node_type_tex_invert(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 90, 80, 100);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_math.c b/source/blender/nodes/intern/TEX_nodes/TEX_math.c
index a17c295eb7f..aee6fb663e5 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_math.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_math.c
@@ -174,20 +174,16 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &valuefn, data);
}
-bNodeType tex_node_math= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_MATH,
- /* name */ "Math",
- /* width+range */ 120, 110, 160,
- /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "node_math",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
+void register_node_type_tex_math(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 120, 110, 160);
+ node_type_storage(&ntype, "node_math", NULL, NULL);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
index c709d58b8ba..565ac68c5b7 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
@@ -60,20 +60,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_mix_rgb= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_MIX_RGB,
- /* name */ "Mix",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_mix_rgb(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 100, 60, 150);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
index 1be2e8f1c56..b10cfa543a1 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
@@ -152,20 +152,16 @@ static void copy(bNode *orig, bNode *new)
assign_index(new);
}
-bNodeType tex_node_output= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_OUTPUT,
- /* name */ "Output",
- /* width+range */ 150, 60, 200,
- /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW | NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ NULL,
- /* storage */ "TexNodeOutput",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ init,
- /* freestoragefunc */ node_free_standard_storage,
- /* copystoragefunc */ copy,
- /* id */ NULL
-};
-
+void register_node_type_tex_output(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS,
+ inputs, NULL);
+ node_type_size(&ntype, 150, 60, 200);
+ node_type_init(&ntype, init);
+ node_type_storage(&ntype, "TexNodeOutput", node_free_standard_storage, copy);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
index a4a608e777c..bba25ea7bd2 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
@@ -290,21 +290,29 @@ static void init(bNode *node)
/* Node type definitions */
#define TexDef(TEXTYPE, outputs, name, Name) \
- { NULL, NULL, TEX_NODE_PROC+TEXTYPE, Name, 140,80,140, NODE_CLASS_TEXTURE, \
- NODE_OPTIONS | NODE_PREVIEW, name##_inputs, outputs, "Tex", name##_exec, NULL, init, \
- node_free_standard_storage, node_copy_standard_storage, NULL }
+void register_node_type_tex_proc_##name(ListBase *lb) \
+{ \
+ static bNodeType ntype; \
+ \
+ node_type_base(&ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS, name##_inputs, outputs); \
+ node_type_size(&ntype, 140, 80, 140); \
+ node_type_init(&ntype, init); \
+ node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
+ node_type_exec(&ntype, name##_exec); \
+ \
+ nodeRegisterType(lb, &ntype); \
+}
#define C outputs_color_only
#define CV outputs_both
-bNodeType tex_node_proc_voronoi = TexDef(TEX_VORONOI, CV, voronoi, "Voronoi" );
-bNodeType tex_node_proc_blend = TexDef(TEX_BLEND, C, blend, "Blend" );
-bNodeType tex_node_proc_magic = TexDef(TEX_MAGIC, C, magic, "Magic" );
-bNodeType tex_node_proc_marble = TexDef(TEX_MARBLE, CV, marble, "Marble" );
-bNodeType tex_node_proc_clouds = TexDef(TEX_CLOUDS, CV, clouds, "Clouds" );
-bNodeType tex_node_proc_wood = TexDef(TEX_WOOD, CV, wood, "Wood" );
-bNodeType tex_node_proc_musgrave = TexDef(TEX_MUSGRAVE, CV, musgrave, "Musgrave" );
-bNodeType tex_node_proc_noise = TexDef(TEX_NOISE, C, noise, "Noise" );
-bNodeType tex_node_proc_stucci = TexDef(TEX_STUCCI, CV, stucci, "Stucci" );
-bNodeType tex_node_proc_distnoise = TexDef(TEX_DISTNOISE, CV, distnoise, "Distorted Noise" );
-
+TexDef(TEX_VORONOI, CV, voronoi, "Voronoi" );
+TexDef(TEX_BLEND, C, blend, "Blend" );
+TexDef(TEX_MAGIC, C, magic, "Magic" );
+TexDef(TEX_MARBLE, CV, marble, "Marble" );
+TexDef(TEX_CLOUDS, CV, clouds, "Clouds" );
+TexDef(TEX_WOOD, CV, wood, "Wood" );
+TexDef(TEX_MUSGRAVE, CV, musgrave, "Musgrave" );
+TexDef(TEX_NOISE, C, noise, "Noise" );
+TexDef(TEX_STUCCI, CV, stucci, "Stucci" );
+TexDef(TEX_DISTNOISE, CV, distnoise, "Distorted Noise" );
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
index 88ed5382a6a..92a9fa26311 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
@@ -90,20 +90,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_rotate= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_ROTATE,
- /* name */ "Rotate",
- /* width+range */ 90, 80, 100,
- /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
+void register_node_type_tex_rotate(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 140, 100, 320);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
index 8045c1ca07a..65ae744531b 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
@@ -64,20 +64,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_scale = {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_SCALE,
- /* name */ "Scale",
- /* width+range */ 90, 80, 100,
- /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
+void register_node_type_tex_scale(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 90, 80, 100);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
index c01caa022e5..2bbd08a4c1f 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
@@ -83,21 +83,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_texture= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_TEXTURE,
- /* name */ "Texture",
- /* width+range */ 120, 80, 240,
- /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_texture(ListBase *lb)
+{
+ static bNodeType ntype;
-};
-
+ node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 120, 80, 240);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
index a9d7fbcf3da..a570386bcda 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
@@ -59,20 +59,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &colorfn, data);
}
-bNodeType tex_node_translate = {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_TRANSLATE,
- /* name */ "Translate",
- /* width+range */ 90, 80, 100,
- /* class+opts */ NODE_CLASS_DISTORT, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
+void register_node_type_tex_translate(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 90, 80, 100);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
index c71d442cef3..67fb068870c 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
@@ -75,20 +75,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
tex_output(node, in, out[0], &normalfn, data);
}
-bNodeType tex_node_valtonor = {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_VALTONOR,
- /* name */ "Value to Normal",
- /* width+range */ 90, 80, 100,
- /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-};
-
+void register_node_type_tex_valtonor(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_VALTONOR, "Value to Normal", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ inputs, outputs);
+ node_type_size(&ntype, 90, 80, 100);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
index fcaa9550efa..f23baffb0ee 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
@@ -58,23 +58,19 @@ static void valtorgb_init(bNode *node)
node->storage = add_colorband(1);
}
-bNodeType tex_node_valtorgb= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_VALTORGB,
- /* name */ "ColorRamp",
- /* width+range */ 240, 200, 300,
- /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
- /* input sock */ valtorgb_in,
- /* output sock */ valtorgb_out,
- /* storage */ "ColorBand",
- /* execfunc */ valtorgb_exec,
- /* butfunc */ NULL,
- /* initfunc */ valtorgb_init,
- /* freestoragefunc */ node_free_standard_storage,
- /* copystoragefunc */ node_copy_standard_storage,
- /* id */ NULL
+void register_node_type_tex_valtorgb(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ valtorgb_in, valtorgb_out);
+ node_type_size(&ntype, 240, 200, 300);
+ node_type_init(&ntype, valtorgb_init);
+ node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage);
+ node_type_exec(&ntype, valtorgb_exec);
+
+ nodeRegisterType(lb, &ntype);
+}
/* **************** RGBTOBW ******************** */
static bNodeSocketType rgbtobw_in[]= {
@@ -100,21 +96,15 @@ static void rgbtobw_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **
tex_output(node, in, out[0], &rgbtobw_valuefn, data);
}
-bNodeType tex_node_rgbtobw= {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_RGBTOBW,
- /* name */ "RGB to BW",
- /* width+range */ 80, 40, 120,
- /* class+opts */ NODE_CLASS_CONVERTOR, 0,
- /* input sock */ rgbtobw_in,
- /* output sock */ rgbtobw_out,
- /* storage */ "",
- /* execfunc */ rgbtobw_exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
-
-};
+void register_node_type_tex_rgbtobw(ListBase *lb)
+{
+ static bNodeType ntype;
+
+ node_type_base(&ntype, TEX_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0,
+ rgbtobw_in, rgbtobw_out);
+ node_type_size(&ntype, 80, 40, 120);
+ node_type_exec(&ntype, rgbtobw_exec);
+
+ nodeRegisterType(lb, &ntype);
+}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
index 75fe6945261..5dbfc2561b5 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
@@ -51,20 +51,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
}
}
-bNodeType tex_node_viewer = {
- /* *next,*prev */ NULL, NULL,
- /* type code */ TEX_NODE_VIEWER,
- /* name */ "Viewer",
- /* width+range */ 100, 60, 150,
- /* class+opts */ NODE_CLASS_OUTPUT, NODE_PREVIEW,
- /* input sock */ inputs,
- /* output sock */ outputs,
- /* storage */ "",
- /* execfunc */ exec,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copystoragefunc */ NULL,
- /* id */ NULL
+void register_node_type_tex_viewer(ListBase *lb)
+{
+ static bNodeType ntype;
-};
+ node_type_base(&ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW,
+ inputs, outputs);
+ node_type_size(&ntype, 100, 60, 150);
+ node_type_exec(&ntype, exec);
+
+ nodeRegisterType(lb, &ntype);
+}