From e8872a8ea259c856aab188cda8eb4502d6a02cfc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 7 Oct 2012 09:48:59 +0000 Subject: style cleanup: if(); --- source/blender/nodes/texture/nodes/node_texture_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index ce22bc00a55..fdd3b97ad59 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -65,7 +65,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o tex_input_rgba(&target->tr, in[0], ¶ms, cdata->thread); target->tin = (target->tr + target->tg + target->tb) / 3.0f; - target->talpha = 1; + target->talpha = TRUE; if (target->nor) { if (in[1] && in[1]->hasinput) -- cgit v1.2.3 From 92862f96dc537242f66a6b5ebe0fc3f835acada0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Oct 2012 23:11:59 +0000 Subject: code cleanup: use float sizes for function args. --- source/blender/nodes/texture/node_texture_tree.c | 28 +++++++++++----------- source/blender/nodes/texture/node_texture_util.c | 22 ++++++++--------- source/blender/nodes/texture/node_texture_util.h | 6 +++-- .../nodes/texture/nodes/node_texture_bricks.c | 2 +- .../nodes/texture/nodes/node_texture_proc.c | 6 ++--- .../nodes/texture/nodes/node_texture_rotate.c | 2 +- .../nodes/texture/nodes/node_texture_valToNor.c | 2 +- 7 files changed, 35 insertions(+), 33 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 9656d93f1b0..1bfd88d3af7 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -240,19 +240,19 @@ void ntreeTexEndExecTree(bNodeTreeExec *exec, int use_tree_data) } int ntreeTexExecTree( - bNodeTree *nodes, - TexResult *texres, - float *co, - float *dxt, float *dyt, - int osatex, - short thread, - Tex *UNUSED(tex), - short which_output, - int cfra, - int preview, - ShadeInput *shi, - MTex *mtex -) { + bNodeTree *nodes, + TexResult *texres, + float co[3], + float dxt[3], float dyt[3], + int osatex, + const short thread, + Tex *UNUSED(tex), + short which_output, + int cfra, + int preview, + ShadeInput *shi, + MTex *mtex) +{ TexCallData data; float *nor = texres->nor; int retval = TEX_INT; diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c index 5e58b74ac3a..06473d800d0 100644 --- a/source/blender/nodes/texture/node_texture_util.c +++ b/source/blender/nodes/texture/node_texture_util.c @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -29,7 +29,7 @@ * \ingroup nodes */ - + /* * HOW TEXTURE NODES WORK * @@ -112,13 +112,13 @@ void params_from_cdata(TexParams *out, TexCallData *in) out->mtex = in->mtex; } -void tex_do_preview(bNode *node, float *co, float *col) +void tex_do_preview(bNode *node, const float coord[2], const float col[4]) { - bNodePreview *preview= node->preview; + bNodePreview *preview = node->preview; if (preview) { - int xs= ((co[0] + 1.0f)*0.5f)*preview->xsize; - int ys= ((co[1] + 1.0f)*0.5f)*preview->ysize; + int xs = ((coord[0] + 1.0f) * 0.5f) * preview->xsize; + int ys = ((coord[1] + 1.0f) * 0.5f) * preview->ysize; nodeAddToPreview(node, col, xs, ys, 0); /* 0 = no color management */ } @@ -132,19 +132,19 @@ void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn, TexC dg = out->data = MEM_mallocN(sizeof(TexDelegate), "tex delegate"); else dg = out->data; - - dg->cdata= cdata; + + dg->cdata = cdata; dg->fn = texfn; dg->node = node; - memcpy(dg->in, in, MAX_SOCKET * sizeof(bNodeStack*)); + memcpy(dg->in, in, MAX_SOCKET * sizeof(bNodeStack *)); dg->type = out->sockettype; } void ntreeTexCheckCyclics(struct bNodeTree *ntree) { bNode *node; - for (node= ntree->nodes.first; node; node= node->next) { - + for (node = ntree->nodes.first; node; node = node->next) { + if (node->type == TEX_NODE_TEXTURE && node->id) { /* custom2 stops the node from rendering */ if (node->custom1) { diff --git a/source/blender/nodes/texture/node_texture_util.h b/source/blender/nodes/texture/node_texture_util.h index e938e6fc419..16dbc2f7bfb 100644 --- a/source/blender/nodes/texture/node_texture_util.h +++ b/source/blender/nodes/texture/node_texture_util.h @@ -79,8 +79,10 @@ typedef struct TexCallData { TexResult *target; + /* all float[3] */ float *co; float *dxt, *dyt; + int osatex; char do_preview; short thread; @@ -94,7 +96,7 @@ typedef struct TexCallData { typedef struct TexParams { float *co; float *dxt, *dyt; - float *previewco; + const float *previewco; int cfra; int osatex; @@ -119,7 +121,7 @@ void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread); float tex_input_value(bNodeStack *in, TexParams *params, short thread); void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *data); -void tex_do_preview(bNode *node, float *coord, float *col); +void tex_do_preview(bNode *node, const float coord[2], const float col[4]); void params_from_cdata(TexParams *out, TexCallData *in); diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index f6259962529..c575547b3ce 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -66,7 +66,7 @@ static float noise(int n) /* fast integer noise */ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float *co = p->co; + const float *co = p->co; float x = co[0]; float y = co[1]; diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index 102f6e1c428..1f724292661 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -57,7 +57,7 @@ static bNodeSocketTemplate outputs_color_only[]= { { SOCK_RGBA, 1, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f } /* Calls multitex and copies the result to the outputs. Called by xxx_exec, which handles inputs. */ -static void do_proc(float *result, TexParams *p, float *col1, float *col2, char is_normal, Tex *tex, short thread) +static void do_proc(float *result, TexParams *p, const float col1[4], const float col2[4], char is_normal, Tex *tex, const short thread) { TexResult texres; int textype; @@ -69,7 +69,7 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char texres.nor = NULL; textype = multitex_nodes(tex, p->co, p->dxt, p->dyt, p->osatex, - &texres, thread, 0, p->shi, p->mtex); + &texres, thread, 0, p->shi, p->mtex); if (is_normal) return; @@ -83,7 +83,7 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char } } -typedef void (*MapFn) (Tex *tex, bNodeStack **in, TexParams *p, short thread); +typedef void (*MapFn) (Tex *tex, bNodeStack **in, TexParams *p, const short thread); static void texfn( float *result, diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index a7832c8c180..2f997d36e71 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -47,7 +47,7 @@ static bNodeSocketTemplate outputs[]= { { -1, 0, "" } }; -static void rotate(float new_co[3], float a, float ax[3], float co[3]) +static void rotate(float new_co[3], float a, float ax[3], const float co[3]) { float para[3]; float perp[3]; diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index 2d107b87578..73dcc72eb40 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -47,7 +47,7 @@ static bNodeSocketTemplate outputs[]= { static void normalfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float new_co[3]; - float *co = p->co; + const float *co = p->co; float nabla = tex_input_value(in[1], p, thread); float val; -- cgit v1.2.3 From f3ece5a108db0bdbefb4663ef4ebd9a7e039e263 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Oct 2012 05:46:41 +0000 Subject: style cleanup: trailing tabs & expand some non prefix tabs into spaces. --- source/blender/nodes/texture/nodes/node_texture_checker.c | 2 +- source/blender/nodes/texture/nodes/node_texture_distance.c | 2 +- source/blender/nodes/texture/nodes/node_texture_invert.c | 8 ++++---- source/blender/nodes/texture/nodes/node_texture_math.c | 12 ++++++------ source/blender/nodes/texture/nodes/node_texture_rotate.c | 6 +++--- source/blender/nodes/texture/nodes/node_texture_scale.c | 6 +++--- source/blender/nodes/texture/nodes/node_texture_translate.c | 6 +++--- source/blender/nodes/texture/nodes/node_texture_valToNor.c | 8 ++++---- 8 files changed, 25 insertions(+), 25 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c index cd9c3170cf7..72e3520ebd4 100644 --- a/source/blender/nodes/texture/nodes/node_texture_checker.c +++ b/source/blender/nodes/texture/nodes/node_texture_checker.c @@ -62,7 +62,7 @@ static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack ** } else { tex_input_rgba(out, in[1], p, thread); - } + } } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/texture/nodes/node_texture_distance.c b/source/blender/nodes/texture/nodes/node_texture_distance.c index 29f08a0ded0..07424a81587 100644 --- a/source/blender/nodes/texture/nodes/node_texture_distance.c +++ b/source/blender/nodes/texture/nodes/node_texture_distance.c @@ -38,7 +38,7 @@ static bNodeSocketTemplate inputs[]= { { SOCK_VECTOR, 1, N_("Coordinate 1"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Coordinate 2"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, - { -1, 0, "" } + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c index 0339c3f0cf2..934a60451a4 100644 --- a/source/blender/nodes/texture/nodes/node_texture_invert.c +++ b/source/blender/nodes/texture/nodes/node_texture_invert.c @@ -35,13 +35,13 @@ /* **************** INVERT ******************** */ static bNodeSocketTemplate inputs[]= { - { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, - { -1, 0, "" } + { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { SOCK_RGBA, 0, N_("Color")}, + { -1, 0, "" } }; static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index 36e9cac0827..b5ebc1f2c45 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -36,14 +36,14 @@ /* **************** SCALAR MATH ******************** */ static bNodeSocketTemplate inputs[]= { - { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, - { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, - { -1, 0, "" } + { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_FLOAT, 0, N_("Value")}, - { -1, 0, "" } + { SOCK_FLOAT, 0, N_("Value")}, + { -1, 0, "" } }; static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) @@ -178,7 +178,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor fprintf(stderr, "%s:%d: unhandeld value in switch statement: %d\n", __FILE__, __LINE__, node->custom1); - } + } } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index 2f997d36e71..8f50eaece4f 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -39,12 +39,12 @@ static bNodeSocketTemplate inputs[]= { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Turns"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Axis"), 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, PROP_DIRECTION }, - { -1, 0, "" } + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { SOCK_RGBA, 0, N_("Color")}, + { -1, 0, "" } }; static void rotate(float new_co[3], float a, float ax[3], const float co[3]) diff --git a/source/blender/nodes/texture/nodes/node_texture_scale.c b/source/blender/nodes/texture/nodes/node_texture_scale.c index 130a21ba84d..4bc283fc33c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_scale.c +++ b/source/blender/nodes/texture/nodes/node_texture_scale.c @@ -36,12 +36,12 @@ static bNodeSocketTemplate inputs[]= { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 1, N_("Scale"), 1.0f, 1.0f, 1.0f, 0.0f, -10.0f, 10.0f, PROP_XYZ }, - { -1, 0, "" } + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { SOCK_RGBA, 0, N_("Color")}, + { -1, 0, "" } }; static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) diff --git a/source/blender/nodes/texture/nodes/node_texture_translate.c b/source/blender/nodes/texture/nodes/node_texture_translate.c index 85f857ca2be..bce60198a5d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_translate.c +++ b/source/blender/nodes/texture/nodes/node_texture_translate.c @@ -37,12 +37,12 @@ static bNodeSocketTemplate inputs[]= { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Offset"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_TRANSLATION }, - { -1, 0, "" } + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { SOCK_RGBA, 0, N_("Color")}, + { -1, 0, "" } }; static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index 73dcc72eb40..fe3ea908e26 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -36,12 +36,12 @@ static bNodeSocketTemplate inputs[]= { { SOCK_FLOAT, 1, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE }, { SOCK_FLOAT, 1, N_("Nabla"), 0.025f, 0.0f, 0.0f, 0.0f, 0.001f, 0.1f, PROP_UNSIGNED }, - { -1, 0, "" } + { -1, 0, "" } }; static bNodeSocketTemplate outputs[]= { - { SOCK_VECTOR, 0, N_("Normal") }, - { -1, 0, "" } + { SOCK_VECTOR, 0, N_("Normal") }, + { -1, 0, "" } }; static void normalfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) @@ -49,7 +49,7 @@ static void normalfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack * float new_co[3]; const float *co = p->co; - float nabla = tex_input_value(in[1], p, thread); + float nabla = tex_input_value(in[1], p, thread); float val; float nor[3]; -- cgit v1.2.3 From ddc2dbc2a47ed2439a62e82ad6fba7d8c9dcae28 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Oct 2012 08:15:51 +0000 Subject: style cleanup --- .../blender/nodes/texture/nodes/node_texture_at.c | 4 ++-- .../nodes/texture/nodes/node_texture_bricks.c | 4 ++-- .../nodes/texture/nodes/node_texture_checker.c | 4 ++-- .../nodes/texture/nodes/node_texture_compose.c | 4 ++-- .../nodes/texture/nodes/node_texture_coord.c | 2 +- .../nodes/texture/nodes/node_texture_curves.c | 6 +++--- .../nodes/texture/nodes/node_texture_decompose.c | 4 ++-- .../nodes/texture/nodes/node_texture_distance.c | 4 ++-- .../nodes/texture/nodes/node_texture_hueSatVal.c | 14 ++++++------- .../nodes/texture/nodes/node_texture_image.c | 2 +- .../nodes/texture/nodes/node_texture_invert.c | 4 ++-- .../nodes/texture/nodes/node_texture_math.c | 6 +++--- .../nodes/texture/nodes/node_texture_mixRgb.c | 4 ++-- .../nodes/texture/nodes/node_texture_output.c | 2 +- .../nodes/texture/nodes/node_texture_proc.c | 24 +++++++++++----------- .../nodes/texture/nodes/node_texture_rotate.c | 4 ++-- .../nodes/texture/nodes/node_texture_scale.c | 4 ++-- .../nodes/texture/nodes/node_texture_texture.c | 4 ++-- .../nodes/texture/nodes/node_texture_translate.c | 4 ++-- .../nodes/texture/nodes/node_texture_valToNor.c | 4 ++-- .../nodes/texture/nodes/node_texture_valToRgb.c | 8 ++++---- 21 files changed, 58 insertions(+), 58 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/nodes/node_texture_at.c b/source/blender/nodes/texture/nodes/node_texture_at.c index 9e557705b3f..4c2d276b902 100644 --- a/source/blender/nodes/texture/nodes/node_texture_at.c +++ b/source/blender/nodes/texture/nodes/node_texture_at.c @@ -33,12 +33,12 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Texture"), 0.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 1, N_("Coordinates"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Texture") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index c575547b3ce..b4f81f08e43 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -35,7 +35,7 @@ #include -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Bricks 1"), 0.596f, 0.282f, 0.0f, 1.0f }, { SOCK_RGBA, 1, N_("Bricks 2"), 0.632f, 0.504f, 0.05f, 1.0f }, { SOCK_RGBA, 1, N_("Mortar"), 0.0f, 0.0f, 0.0f, 1.0f }, @@ -45,7 +45,7 @@ static bNodeSocketTemplate inputs[]= { { SOCK_FLOAT, 1, N_("Row Height"), 0.25f, 0.0f, 0.0f, 0.0f, 0.001f, 99.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c index 72e3520ebd4..1f653d1f7b9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_checker.c +++ b/source/blender/nodes/texture/nodes/node_texture_checker.c @@ -34,13 +34,13 @@ #include "NOD_texture.h" #include -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color1"), 1.0f, 0.0f, 0.0f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 1.0f, 1.0f, 1.0f, 1.0f }, { SOCK_FLOAT, 1, N_("Size"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 100.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c index 77521190590..25da4f19e52 100644 --- a/source/blender/nodes/texture/nodes/node_texture_compose.c +++ b/source/blender/nodes/texture/nodes/node_texture_compose.c @@ -33,14 +33,14 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Green"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Blue"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_coord.c b/source/blender/nodes/texture/nodes/node_texture_coord.c index 2add5c820eb..971520ebc38 100644 --- a/source/blender/nodes/texture/nodes/node_texture_coord.c +++ b/source/blender/nodes/texture/nodes/node_texture_coord.c @@ -33,7 +33,7 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_VECTOR, 0, N_("Coordinates") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c index 6ccb5e1e83f..5980f938938 100644 --- a/source/blender/nodes/texture/nodes/node_texture_curves.c +++ b/source/blender/nodes/texture/nodes/node_texture_curves.c @@ -36,7 +36,7 @@ /* **************** CURVE Time ******************** */ /* custom1 = sfra, custom2 = efra */ -static bNodeSocketTemplate time_outputs[]= { +static bNodeSocketTemplate time_outputs[] = { { SOCK_FLOAT, 0, N_("Value") }, { -1, 0, "" } }; @@ -83,12 +83,12 @@ void register_node_type_tex_curve_time(bNodeTreeType *ttype) } /* **************** CURVE RGB ******************** */ -static bNodeSocketTemplate rgb_inputs[]= { +static bNodeSocketTemplate rgb_inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate rgb_outputs[]= { +static bNodeSocketTemplate rgb_outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_decompose.c b/source/blender/nodes/texture/nodes/node_texture_decompose.c index eae34e2ce47..a2875c31d9e 100644 --- a/source/blender/nodes/texture/nodes/node_texture_decompose.c +++ b/source/blender/nodes/texture/nodes/node_texture_decompose.c @@ -34,11 +34,11 @@ #include "NOD_texture.h" #include -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Red") }, { SOCK_FLOAT, 0, N_("Green") }, { SOCK_FLOAT, 0, N_("Blue") }, diff --git a/source/blender/nodes/texture/nodes/node_texture_distance.c b/source/blender/nodes/texture/nodes/node_texture_distance.c index 07424a81587..8c3b1555d5d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_distance.c +++ b/source/blender/nodes/texture/nodes/node_texture_distance.c @@ -35,13 +35,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_VECTOR, 1, N_("Coordinate 1"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Coordinate 2"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Value") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 6863eab9150..b5e9969a830 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -34,7 +34,7 @@ #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Hue"), 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, PROP_NONE }, { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, @@ -42,7 +42,7 @@ static bNodeSocketTemplate inputs[]= { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; @@ -56,14 +56,14 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat hsv[0]+= (hue - 0.5f); if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f; hsv[1]*= sat; - if (hsv[1]>1.0f) hsv[1]= 1.0f; else if (hsv[1]<0.0f) hsv[1]= 0.0f; + if (hsv[1]>1.0f) hsv[1] = 1.0f; else if (hsv[1]<0.0f) hsv[1] = 0.0f; hsv[2]*= val; - if (hsv[2]>1.0f) hsv[2]= 1.0f; else if (hsv[2]<0.0f) hsv[2]= 0.0f; + if (hsv[2]>1.0f) hsv[2] = 1.0f; else if (hsv[2]<0.0f) hsv[2] = 0.0f; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - out[0]= mfac*in[0] + fac*col[0]; - out[1]= mfac*in[1] + fac*col[1]; - out[2]= mfac*in[2] + fac*col[2]; + out[0] = mfac*in[0] + fac*col[0]; + out[1] = mfac*in[1] + fac*col[1]; + out[2] = mfac*in[2] + fac*col[2]; } else { copy_v4_v4(out, in); diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c index 7ce91c37295..f3fdaf0bb64 100644 --- a/source/blender/nodes/texture/nodes/node_texture_image.c +++ b/source/blender/nodes/texture/nodes/node_texture_image.c @@ -33,7 +33,7 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Image")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c index 934a60451a4..9c2963d2dc2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_invert.c +++ b/source/blender/nodes/texture/nodes/node_texture_invert.c @@ -34,12 +34,12 @@ #include "NOD_texture.h" /* **************** INVERT ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index b5ebc1f2c45..95d70ccc7d6 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -35,13 +35,13 @@ /* **************** SCALAR MATH ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE}, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Value")}, { -1, 0, "" } }; @@ -112,7 +112,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor { /* Only raise negative numbers by full integers */ if ( in0 >= 0 ) { - out[0]= pow(in0, in1); + out[0] = pow(in0, in1); } else { float y_mod_1 = fmod(in1, 1); diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index bf6cb7a3262..fe04854c734 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -34,13 +34,13 @@ #include "NOD_texture.h" /* **************** MIX RGB ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Factor"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR }, { SOCK_RGBA, 1, N_("Color1"), 0.5f, 0.5f, 0.5f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 0.5f, 0.5f, 0.5f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index fdd3b97ad59..5867dc03050 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -34,7 +34,7 @@ #include "NOD_texture.h" /* **************** COMPOSITE ******************** */ -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION}, { -1, 0, "" } diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index 1f724292661..8876d98b9b2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -40,12 +40,12 @@ */ -static bNodeSocketTemplate outputs_both[]= { +static bNodeSocketTemplate outputs_both[] = { { SOCK_RGBA, 0, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 0, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs_color_only[]= { +static bNodeSocketTemplate outputs_color_only[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; @@ -138,7 +138,7 @@ static int count_outputs(bNode *node) /* --- VORONOI -- */ -static bNodeSocketTemplate voronoi_inputs[]= { +static bNodeSocketTemplate voronoi_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("W1"), 1.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE }, { SOCK_FLOAT, 1, N_("W2"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_NONE }, @@ -163,7 +163,7 @@ static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short th ProcDef(voronoi) /* --- BLEND -- */ -static bNodeSocketTemplate blend_inputs[]= { +static bNodeSocketTemplate blend_inputs[] = { COMMON_INPUTS, { -1, 0, "" } }; @@ -171,7 +171,7 @@ ProcNoInputs(blend) ProcDef(blend) /* -- MAGIC -- */ -static bNodeSocketTemplate magic_inputs[]= { +static bNodeSocketTemplate magic_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, { -1, 0, "" } @@ -183,7 +183,7 @@ static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thre ProcDef(magic) /* --- MARBLE --- */ -static bNodeSocketTemplate marble_inputs[]= { +static bNodeSocketTemplate marble_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, @@ -197,7 +197,7 @@ static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thr ProcDef(marble) /* --- CLOUDS --- */ -static bNodeSocketTemplate clouds_inputs[]= { +static bNodeSocketTemplate clouds_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { -1, 0, "" } @@ -209,7 +209,7 @@ static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thr ProcDef(clouds) /* --- DISTORTED NOISE --- */ -static bNodeSocketTemplate distnoise_inputs[]= { +static bNodeSocketTemplate distnoise_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Distortion"), 1.00f, 0.0f, 0.0f, 0.0f, 0.0000f, 10.0f, PROP_UNSIGNED }, @@ -223,7 +223,7 @@ static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short ProcDef(distnoise) /* --- WOOD --- */ -static bNodeSocketTemplate wood_inputs[]= { +static bNodeSocketTemplate wood_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, @@ -237,7 +237,7 @@ static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short threa ProcDef(wood) /* --- MUSGRAVE --- */ -static bNodeSocketTemplate musgrave_inputs[]= { +static bNodeSocketTemplate musgrave_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("H"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Lacunarity"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 6.0f, PROP_UNSIGNED }, @@ -258,7 +258,7 @@ static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short t ProcDef(musgrave) /* --- NOISE --- */ -static bNodeSocketTemplate noise_inputs[]= { +static bNodeSocketTemplate noise_inputs[] = { COMMON_INPUTS, { -1, 0, "" } }; @@ -266,7 +266,7 @@ ProcNoInputs(noise) ProcDef(noise) /* --- STUCCI --- */ -static bNodeSocketTemplate stucci_inputs[]= { +static bNodeSocketTemplate stucci_inputs[] = { COMMON_INPUTS, { SOCK_FLOAT, 1, N_("Size"), 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f, PROP_UNSIGNED }, { SOCK_FLOAT, 1, N_("Turbulence"), 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f, PROP_UNSIGNED }, diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index 8f50eaece4f..1b1d57044a3 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -35,14 +35,14 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Turns"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE }, { SOCK_VECTOR, 1, N_("Axis"), 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, PROP_DIRECTION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_scale.c b/source/blender/nodes/texture/nodes/node_texture_scale.c index 4bc283fc33c..56562724fb9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_scale.c +++ b/source/blender/nodes/texture/nodes/node_texture_scale.c @@ -33,13 +33,13 @@ #include #include "node_texture_util.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { SOCK_VECTOR, 1, N_("Scale"), 1.0f, 1.0f, 1.0f, 0.0f, -10.0f, 10.0f, PROP_XYZ }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 4832f19f2c7..cc7367a7632 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -35,13 +35,13 @@ #include "RE_shader_ext.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color1"), 1.0f, 1.0f, 1.0f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 0.0f, 0.0f, 0.0f, 1.0f }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_translate.c b/source/blender/nodes/texture/nodes/node_texture_translate.c index bce60198a5d..a95cb00a47d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_translate.c +++ b/source/blender/nodes/texture/nodes/node_texture_translate.c @@ -34,13 +34,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Offset"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_TRANSLATION }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index fe3ea908e26..bbfc1fa616b 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -33,13 +33,13 @@ #include "node_texture_util.h" #include "NOD_texture.h" -static bNodeSocketTemplate inputs[]= { +static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE }, { SOCK_FLOAT, 1, N_("Nabla"), 0.025f, 0.0f, 0.0f, 0.0f, 0.001f, 0.1f, PROP_UNSIGNED }, { -1, 0, "" } }; -static bNodeSocketTemplate outputs[]= { +static bNodeSocketTemplate outputs[] = { { SOCK_VECTOR, 0, N_("Normal") }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c index 515613509f6..78635453fc1 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c @@ -34,11 +34,11 @@ #include "NOD_texture.h" /* **************** VALTORGB ******************** */ -static bNodeSocketTemplate valtorgb_in[]= { +static bNodeSocketTemplate valtorgb_in[] = { { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }; -static bNodeSocketTemplate valtorgb_out[]= { +static bNodeSocketTemplate valtorgb_out[] = { { SOCK_RGBA, 0, N_("Color")}, { -1, 0, "" } }; @@ -77,11 +77,11 @@ void register_node_type_tex_valtorgb(bNodeTreeType *ttype) } /* **************** RGBTOBW ******************** */ -static bNodeSocketTemplate rgbtobw_in[]= { +static bNodeSocketTemplate rgbtobw_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate rgbtobw_out[]= { +static bNodeSocketTemplate rgbtobw_out[] = { { SOCK_FLOAT, 0, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { -1, 0, "" } }; -- cgit v1.2.3 From cbae51bc9321a86aaf04bbd324086d09c0eac6cf Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Wed, 24 Oct 2012 10:00:28 +0000 Subject: Removed the experimental (and commented-out) code for FOR and WHILE loops in nodes. This was a feature i tested a while back but was only partially supported by Blender Internal renderer and the old compositor. The main idea was to have nodes that automatically mirror input and output sockets to support incremental changes of "internal variables". It is not a well-supported feature of the primary node systems (shader, compositor, texture) in Blender. If anybody wants to create a node system that has actual use for loops, they can do so much more elegantly with Python nodes, but it does not have to be a core node type in Blender. Removing this should ease node code maintenance a bit. --- .../nodes/texture/nodes/node_texture_common.c | 125 --------------------- 1 file changed, 125 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c index 1eaf9b2b0fe..41bfd0ae00a 100644 --- a/source/blender/nodes/texture/nodes/node_texture_common.c +++ b/source/blender/nodes/texture/nodes/node_texture_common.c @@ -148,128 +148,3 @@ void register_node_type_tex_group(bNodeTreeType *ttype) nodeRegisterType(ttype, &ntype); } - - -/**** FOR LOOP ****/ - -#if 0 /* XXX loop nodes don't work nicely with current trees */ -static void forloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out) -{ - bNodeTreeExec *exec= (bNodeTreeExec*)nodedata; - bNodeThreadStack *nts; - int iterations= (int)in[0]->vec[0]; - bNodeSocket *sock; - bNodeStack *ns; - int iteration; - - /* XXX same behavior as trunk: all nodes inside group are executed. - * it's stupid, but just makes it work. compo redesign will do this better. - */ - { - bNode *inode; - for (inode=exec->nodetree->nodes.first; inode; inode=inode->next) - inode->need_exec = 1; - } - - nts = ntreeGetThreadStack(exec, thread); - - /* "Iteration" socket */ - sock = exec->nodetree->inputs.first; - ns = node_get_socket_stack(nts->stack, sock); - -// group_copy_inputs(node, in, nts->stack); - for (iteration=0; iteration < iterations; ++iteration) { - /* first input contains current iteration counter */ - ns->vec[0] = (float)iteration; - ns->vec[1]=ns->vec[2]=ns->vec[3] = 0.0f; - -// if (iteration > 0) -// loop_init_iteration(exec->nodetree, nts->stack); -// ntreeExecThreadNodes(exec, nts, data, thread); - } -// loop_copy_outputs(node, in, out, exec->stack); - - ntreeReleaseThreadStack(nts); -} - -void register_node_type_tex_forloop(bNodeTreeType *ttype) -{ - static bNodeType ntype; - - node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS); - node_type_socket_templates(&ntype, NULL, NULL); - node_type_size(&ntype, 120, 60, 200); - node_type_label(&ntype, node_group_label); - node_type_init(&ntype, node_forloop_init); - node_type_valid(&ntype, node_group_valid); - node_type_template(&ntype, node_forloop_template); - node_type_update(&ntype, NULL, node_group_verify); - node_type_tree(&ntype, node_forloop_init_tree, node_loop_update_tree); - node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear); - node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute); - - nodeRegisterType(ttype, &ntype); -} -#endif - -/**** WHILE LOOP ****/ - -#if 0 /* XXX loop nodes don't work nicely with current trees */ -static void whileloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out) -{ - bNodeTreeExec *exec= (bNodeTreeExec*)nodedata; - bNodeThreadStack *nts; - int condition= (in[0]->vec[0] > 0.0f); - bNodeSocket *sock; - bNodeStack *ns; - int iteration; - - /* XXX same behavior as trunk: all nodes inside group are executed. - * it's stupid, but just makes it work. compo redesign will do this better. - */ - { - bNode *inode; - for (inode=exec->nodetree->nodes.first; inode; inode=inode->next) - inode->need_exec = 1; - } - - nts = ntreeGetThreadStack(exec, thread); - - /* "Condition" socket */ - sock = exec->nodetree->outputs.first; - ns = node_get_socket_stack(nts->stack, sock); - - iteration = 0; -// group_copy_inputs(node, in, nts->stack); - while (condition && iteration < node->custom1) { -// if (iteration > 0) -// loop_init_iteration(exec->nodetree, nts->stack); -// ntreeExecThreadNodes(exec, nts, data, thread); - - condition = (ns->vec[0] > 0.0f); - ++iteration; - } -// loop_copy_outputs(node, in, out, exec->stack); - - ntreeReleaseThreadStack(nts); -} - -void register_node_type_tex_whileloop(bNodeTreeType *ttype) -{ - static bNodeType ntype; - - node_type_base(ttype, &ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS); - node_type_socket_templates(&ntype, NULL, NULL); - node_type_size(&ntype, 120, 60, 200); - node_type_label(&ntype, node_group_label); - node_type_init(&ntype, node_whileloop_init); - node_type_valid(&ntype, node_group_valid); - node_type_template(&ntype, node_whileloop_template); - node_type_update(&ntype, NULL, node_group_verify); - node_type_tree(&ntype, node_whileloop_init_tree, node_loop_update_tree); - node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear); - node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute); - - nodeRegisterType(ttype, &ntype); -} -#endif -- cgit v1.2.3 From 09ed97afc5b20767a67d598fa3ede70892b5d647 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Thu, 25 Oct 2012 16:49:06 +0000 Subject: Internal node links are now cached in a per-node list, instead of being generated as a transient list that is returned from the callback and had to be freed by the caller. These internal links are used for muted nodes, disconnect operators and reroute nodes, to effectively replace the node with direct input-to-output links. Storing this list in the node has the advantage of requiring far fewer calls to the potentially expensive internal_connect callback. This was called on every node redraw ... Also it will allow Cycles to properly use the internal links for muted nodes, which ensures consistent behavior. The previous method was not applicable in Cycles because transient list return values are not supported well in the RNA and particularly the C++ API implementation. --- source/blender/nodes/texture/node_texture_tree.c | 2 +- source/blender/nodes/texture/nodes/node_texture_output.c | 2 +- source/blender/nodes/texture/nodes/node_texture_viewer.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 1bfd88d3af7..ba94531c259 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -134,7 +134,7 @@ bNodeTreeType ntreeType_Texture = { /* update */ update, /* update_node */ NULL, /* validate_link */ NULL, - /* internal_connect */ node_internal_connect_default + /* update_internal_links */ node_update_internal_links_default }; int ntreeTexTagAnimated(bNodeTree *ntree) diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index 5867dc03050..2f5efe8c45e 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -170,7 +170,7 @@ void register_node_type_tex_output(bNodeTreeType *ttype) node_type_exec(&ntype, exec); /* Do not allow muting output. */ - node_type_internal_connect(&ntype, NULL); + node_type_internal_links(&ntype, NULL); nodeRegisterType(ttype, &ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c index bc31bef59d8..5cb8d8c438c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_viewer.c +++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c @@ -66,7 +66,7 @@ void register_node_type_tex_viewer(bNodeTreeType *ttype) node_type_exec(&ntype, exec); /* Do not allow muting viewer node. */ - node_type_internal_connect(&ntype, NULL); + node_type_internal_links(&ntype, NULL); nodeRegisterType(ttype, &ntype); } -- cgit v1.2.3