Page MenuHome

Avoid node tree update tag when changed nodes which are not affecting result
ClosedPublic

Authored by Sergey Sharybin (sergey) on Feb 5 2016, 12:23 PM.

Details

Summary

Avoid node tree update tag when changed nodes which are not affecting result

This was we don't have re-compo or viewport re-rendering happening when changing nodes which are not connected to the output at all (for example when adding new nodes or changing settings for unconnected nodes).

Only basic operations are covered for now. checks could be added to more tools when needed.

Currently it's not fully optimal implementation, but seems to work fast enough. Don't see reliable alternative to that -- keeping tag in the node wouldn't work because of the node groups (which are probably already broken, but should be easy to solve with current approach). So guess it's more matter of optimizing path search from a node to output.

Diff Detail

Repository
rB Blender
Branch
nodes_avoid_update

Event Timeline

Sergey Sharybin (sergey) retitled this revision from to Avoid node tree update tag when changed nodes which are not affecting result.
Sergey Sharybin (sergey) updated this object.

Solved some TODOs and made duplicate/cut work just fine

Solved some TODOs and also avoid update when changing socket value of unconnected node

Fix missing update when disconnecting left side of a link

Generally seems fine, some minor comments.

source/blender/editors/space_node/node_relationships.c
66–70

As long as theres only one of these nodes its fine, probably good to comment on why theres only ever one of these flagged. Could also comment on the NODE_DO_OUTPUT define its self.

74–76

*picky*, am preferring to use 8 spaces indent for function args, means changing return type doesn't mess with arg indentation and if you have to add a new arg you're not having to add loads of spaces (depending on the editor)... but both styles are accepted by our guide too.

102–104

Could use ntreeNodeFlagSet

source/blender/editors/space_node/node_relationships.c
66–70

This actually not really valid for compositor. Compo does have per-node-type single output: you can have Viewer and Compo nodes both having NODE_DO_OUTPUT. So will need to tweak the DFS a bit here.

74–76

Our guidelines allows both styles and i prefer current one. As as far as [1] is concerned i closer to a maintaining the node editor ;)

[1] http://wiki.blender.org/index.php/Dev:Doc/Process/Module_Owners/List

Sergey Sharybin (sergey) edited edge metadata.

Use utility function for clearing flag

Support multiple output nodes and solve uninitialized memory usage in link drag operator

This revision was automatically updated to reflect the committed changes.