From d17e07274ab376ce518c132e36ebc44e4c4fccb4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 29 Apr 2019 20:12:09 +1000 Subject: Cleanup: comments (long lines) in nodes --- source/blender/nodes/composite/node_composite_tree.c | 15 +++++++++------ .../nodes/composite/nodes/node_composite_colorbalance.c | 3 ++- .../nodes/composite/nodes/node_composite_cryptomatte.c | 6 ++++-- .../blender/nodes/composite/nodes/node_composite_image.c | 13 +++++++++---- source/blender/nodes/intern/node_exec.c | 3 ++- source/blender/nodes/intern/node_util.c | 3 ++- source/blender/nodes/shader/node_shader_tree.c | 3 ++- source/blender/nodes/shader/node_shader_util.c | 3 ++- source/blender/nodes/shader/nodes/node_shader_attribute.c | 3 ++- source/blender/nodes/shader/nodes/node_shader_math.c | 3 ++- source/blender/nodes/texture/node_texture_tree.c | 5 +++-- source/blender/nodes/texture/nodes/node_texture_proc.c | 3 ++- 12 files changed, 41 insertions(+), 22 deletions(-) diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index fd6435312b9..43a70a62350 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -247,11 +247,12 @@ void ntreeCompositExecTree(Scene *scene, /* Update the outputs of the render layer nodes. * Since the outputs depend on the render engine, this part is a bit complex: - * - ntreeCompositUpdateRLayers is called and loops over all render layer nodes - * - Each render layer node calls the update function of the render engine that's used for its scene - * - The render engine calls RE_engine_register_pass for each pass - * - RE_engine_register_pass calls ntreeCompositRegisterPass, - * which calls node_cmp_rlayers_register_pass for every render layer node + * - ntreeCompositUpdateRLayers is called and loops over all render layer nodes. + * - Each render layer node calls the update function of the + * render engine that's used for its scene. + * - The render engine calls RE_engine_register_pass for each pass. + * - RE_engine_register_pass calls ntreeCompositRegisterPass,. + * which calls node_cmp_rlayers_register_pass for every render layer node. */ void ntreeCompositUpdateRLayers(bNodeTree *ntree) { @@ -292,7 +293,9 @@ void ntreeCompositTagRender(Scene *curscene) /* XXX Think using G_MAIN here is valid, since you want to update current file's scene nodes, * not the ones in temp main generated for rendering? - * This is still rather weak though, ideally render struct would store own main AND original G_MAIN... */ + * This is still rather weak though, + * ideally render struct would store own main AND original G_MAIN. */ + for (sce = G_MAIN->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) { bNode *node; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c index b0fbade8da4..db0689df775 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c @@ -36,7 +36,8 @@ static bNodeSocketTemplate cmp_node_colorbalance_out[] = { }; /* Sync functions update formula parameters for other modes, such that the result is comparable. - * Note that the results are not exactly the same due to differences in color handling (sRGB conversion happens for LGG), + * Note that the results are not exactly the same due to differences in color handling + * (sRGB conversion happens for LGG), * but this keeps settings comparable. */ diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c index e4c9b8dd0cd..68a7e8d1589 100644 --- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c @@ -71,7 +71,8 @@ static void cryptomatte_add(NodeCryptomatte *n, float f) /* Be aware that token_len still contains any trailing white space. */ token_len = token_end - (n->matte_id + start); - /* If this has a leading bracket, assume a raw floating point number and look for the closing bracket. */ + /* If this has a leading bracket, + * assume a raw floating point number and look for the closing bracket. */ if (n->matte_id[start] == '<') { if (strncmp(n->matte_id + start, number, strlen(number)) == 0) { /* This number is already there, so continue. */ @@ -152,7 +153,8 @@ static void cryptomatte_remove(NodeCryptomatte *n, float f) if (token_len == 1) { skip = true; } - /* If this has a leading bracket, assume a raw floating point number and look for the closing bracket. */ + /* If this has a leading bracket, + * assume a raw floating point number and look for the closing bracket. */ else if (n->matte_id[start] == '<') { if (strncmp(n->matte_id + start, number, strlen(number)) == 0) { /* This number is already there, so skip it. */ diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index ab0932a76aa..e1e23b843a1 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -87,8 +87,11 @@ static void cmp_node_image_add_pass_output(bNodeTree *ntree, if (sock_index < 0) { /* The first 31 sockets always are the legacy hardcoded sockets. - * Any dynamically allocated sockets follow afterwards, and are sorted in the order in which they were stored in the RenderResult. - * Therefore, we remember the index of the last matched socket. New sockets are placed behind the previously traversed one, but always after the first 31. */ + * Any dynamically allocated sockets follow afterwards, + * and are sorted in the order in which they were stored in the RenderResult. + * Therefore, we remember the index of the last matched socket. + * New sockets are placed behind the previously traversed one, + * but always after the first 31. */ int after_index = *prev_index; if (is_rlayers && after_index < 30) { after_index = 30; @@ -340,7 +343,8 @@ static void cmp_node_rlayer_create_outputs(bNodeTree *ntree, &prev_index); } -/* XXX make this into a generic socket verification function for dynamic socket replacement (multilayer, groups, static templates) */ +/* XXX make this into a generic socket verification function for dynamic socket replacement + * (multilayer, groups, static templates) */ static void cmp_node_image_verify_outputs(bNodeTree *ntree, bNode *node, bool rlayer) { bNodeSocket *sock, *sock_next; @@ -363,7 +367,8 @@ static void cmp_node_image_verify_outputs(bNodeTree *ntree, bNode *node, bool rl * Another important detail comes from compatibility with the older socket model, where there * was a fixed socket per pass type that was just hidden or not. Therefore, older versions expect * the first 31 passes to belong to a specific pass type. - * So, we keep those 31 always allocated before the others as well, even if they have no links attached. */ + * So, we keep those 31 always allocated before the others as well, + * even if they have no links attached. */ sock_index = 0; for (sock = node->outputs.first; sock; sock = sock_next, sock_index++) { sock_next = sock->next; diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c index 7fcba8cb472..24376e39f3d 100644 --- a/source/blender/nodes/intern/node_exec.c +++ b/source/blender/nodes/intern/node_exec.c @@ -169,7 +169,8 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, /* ensure all sock->link pointers and node levels are correct */ /* Using global main here is likely totally wrong, not sure what to do about that one though... - * We cannot even check ntree is in global main, since most of the time it won't be (thanks to ntree design)!!! */ + * We cannot even check ntree is in global main, + * since most of the time it won't be (thanks to ntree design)!!! */ ntreeUpdateTree(G.main, ntree); /* get a dependency-sorted list of nodes */ diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c index 4141ccccafa..6ad1c9b6925 100644 --- a/source/blender/nodes/intern/node_util.c +++ b/source/blender/nodes/intern/node_util.c @@ -86,7 +86,8 @@ void node_blend_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int ma void node_image_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen) { - /* if there is no loaded image, return an empty string, and let nodeLabel() fill in the proper type translation. */ + /* If there is no loaded image, return an empty string, + * and let nodeLabel() fill in the proper type translation. */ BLI_strncpy(label, (node->id) ? node->id->name + 2 : "", maxlen); } diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 37ee7dd1221..05ca9394786 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -68,7 +68,8 @@ static bool shader_tree_poll(const bContext *C, bNodeTreeType *UNUSED(treetype)) Scene *scene = CTX_data_scene(C); const char *engine_id = scene->r.engine; - /* allow empty engine string too, this is from older versions that didn't have registerable engines yet */ + /* Allow empty engine string too, + * this is from older versions that didn't have registerable engines yet. */ return (engine_id[0] == '\0' || STREQ(engine_id, RE_engine_id_CYCLES) || !BKE_scene_use_shading_nodes_custom(scene)); } diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index e75cb8a6642..2e8f81979a8 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -88,7 +88,8 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns) memset(gs, 0, sizeof(*gs)); if (ns == NULL) { - /* node_get_stack() will generate NULL bNodeStack pointers for unknown/unsupported types of sockets... */ + /* node_get_stack() will generate NULL bNodeStack pointers + * for unknown/unsupported types of sockets. */ zero_v4(gs->vec); gs->link = NULL; gs->type = GPU_NONE; diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c index 489bb8c3557..ec1bb988c1c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.c +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c @@ -42,7 +42,8 @@ static int node_shader_gpu_attribute(GPUMaterial *mat, { NodeShaderAttribute *attr = node->storage; - /* FIXME : if an attribute layer (like vertex color) has one of theses name, it will not work as expected. */ + /* FIXME : if an attribute layer (like vertex color) has one of theses name, + * it will not work as expected. */ if (strcmp(attr->name, "density") == 0) { return GPU_stack_link( mat, node, "node_attribute_volume_density", in, out, GPU_builtin(GPU_VOLUME_DENSITY)); diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index f8d1617887e..70432e04180 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -159,7 +159,8 @@ static void node_shader_exec_math(void *UNUSED(data), else { float y_mod_1 = fabsf(fmodf(b, 1.0f)); - /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */ + /* if input value is not nearly an integer, + * fall back to zero, nicer than straight rounding. */ if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { r = powf(a, floorf(b + 0.5f)); } diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 60630da586d..43deea9c2de 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -325,8 +325,9 @@ int ntreeTexExecTree(bNodeTree *nodes, retval |= TEX_NOR; } retval |= TEX_RGB; - /* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was set - * however, the texture code checks this for other reasons (namely, a normal is required for material) */ + /* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was + * set however, the texture code checks this for other reasons + * (namely, a normal is required for material). */ texres->nor = nor; return retval; diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index bf7cdf18d44..b0b646dfd16 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -44,7 +44,8 @@ static bNodeSocketTemplate outputs_color_only[] = {{SOCK_RGBA, 0, N_("Color")}, 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. */ +/* Calls multitex and copies the result to the outputs. + * Called by xxx_exec, which handles inputs. */ static void do_proc(float *result, TexParams *p, const float col1[4], -- cgit v1.2.3