"Do not tint cycled nodes" option for node trees.
Needs ReviewPublic

Authored by Alexander Romanov (a.romanov) on Oct 7 2015, 3:13 PM.

Details

Summary

This patch adds the possibility to disable the red tinting in custom node trees with cycled nodes.
How to check:

  1. apply the patch
  2. open attached blend
  3. run the script that is opened in the text editor
  4. in the left node editor window you will see cycled nodes of custom node tree without red tinting; in the right node editor you will see the standard tinting for shader nodes

(updated for generalized option)

Alexander (Blend4Web Team)

Diff Detail

Repository
rB Blender
Branch
arcpatch-D1542
Alexander Romanov (a.romanov) retitled this revision from to "Do not tint cycled nodes" option for node trees..Oct 7 2015, 3:13 PM
Alexander Romanov (a.romanov) updated this object.

Perhaps this should be a general flag to allow cyclic graphs (which I guess is common for logic nodes). Even if these red lines are currently the only thing that is influenced, that could change in the future.

Agree this should be a generalized option, to show a node-tree supports Cyclic.

It could be an enum flag like we have for operators, eg:

class ObjectMoveX(bpy.types.Operator):
    bl_idname = "object.move_x"
    bl_label = "Move X by One"
    bl_options = {'REGISTER', 'UNDO'}

Where bl_options in this case could have one option: bl_options = {'CYCLIC'}.

Campbell Barton (campbellbarton) requested changes to this revision.Oct 9 2015, 6:44 AM

Requesting changes but could use feedback from other devs too.

source/blender/blenkernel/BKE_node.h
271

*picky* could be TREE_TYPE_CYCLIC_SUPPORTED or TREE_TYPE_CYCLIC_OK ... maybe others have opinion? (to make it clear this isn't a flag to check if the tree its self is cyclic).

source/blender/editors/space_node/drawnode.c
3632 ↗(On Diff #5128)

This logic seems error prone, since it mixes up valid links with cyclic node-trees.

Looks like this should be done differently, If cyclic is supported, then NODE_LINK_VALID should be set properly beforehand, and this function need not be modified.

This revision now requires changes to proceed.Oct 9 2015, 6:44 AM
  • Added separate NODE_LINK_CYCLIC flag to identify cyclic links
Alexander Romanov (a.romanov) marked an inline comment as done.Oct 9 2015, 11:05 AM

I added a flag to determine cyclic links.
Also, rB209ca1e746b2 is checked.

source/blender/blenkernel/intern/node.c
3052

I changed the logic here, but maybe I should bring it back.

ok, when we have cycled nodes we need limit to recursions and better to make property in options for recursion depth

ok, when we have cycled nodes we need limit to recursions and better to make property in options for recursion depth

The addon decides the execution logic and should add such options itself if necessary. For example a game logic system might not need it, but rather just execute every node once every tick. In other cases it might make sense to control the number of iterations with a per-node or per-nodetree property, too many different possibilities for a generic Blender option.