Page MenuHome

Nodes: Begin splitting composite node buttons into individual files
ClosedPublic

Authored by Aaron Carlisle (Blendify) on Dec 9 2021, 3:21 AM.

Details

Summary

Currently, most node buttons are defined in drawnode.cc however,
this is inconvenient because it requires editing many files when adding new nodes.
The goal is to minimize the number of files needed to add or update a node.

This commit moves most of the node layout functions for composite nodes into their respected
source/blender/nodes/composite/nodes file.

In the future, these functions will be simplified to node_layout once files have their own namespace.
See D13466: Cleanup: Composite nodes: add namespace for every file for more information.

Diff Detail

Repository
rB Blender
Branch
nodes-composite-split-ui (branched from master)
Build Status
Buildable 19345
Build 19345: arc lint + arc unit

Event Timeline

Aaron Carlisle (Blendify) requested review of this revision.Dec 9 2021, 3:21 AM
Aaron Carlisle (Blendify) created this revision.
Aaron Carlisle (Blendify) retitled this revision from Nodes: Begin splitting composite nodes into individual files to Nodes: Begin splitting composite node buttons into individual files.Dec 9 2021, 3:23 AM

Is there any reason to just do these three, rather than changing all or most of them?

Only to keep the diff small to make sure there are no issues with this change, otherwise, most/all can be moved.

There are some common UIs such as curves, normals, etc... that share the same drawing function among different node tree types, but IMO it is ok to duplicate the code.

  • Move more node buttonds
  • Merge branch 'master' into nodes-composite-split-ui
Aaron Carlisle (Blendify) retitled this revision from Nodes: Begin splitting composite node buttons into individual files to Nodes: splitting composite node buttons into individual node files.Dec 10 2021, 1:03 AM
Aaron Carlisle (Blendify) edited the summary of this revision. (Show Details)
Aaron Carlisle (Blendify) retitled this revision from Nodes: splitting composite node buttons into individual node files to Nodes: Begin splitting composite node buttons into individual files.
Aaron Carlisle (Blendify) edited the summary of this revision. (Show Details)
  • Clang format

this is inconvenient because it is hard to discover

I wouldn't really call it "hard to discover", it's more about making each node more independent, both conceptually and functionally, and decreasing the amount of files related to one node.

Were there any reused functions that are now duplicated in this batch of changes? I do like the idea of one commit for the trivial changes and dealing with the more complex changes separately.

Yes this patch is only the trivial nodes.

When I moved the geometry nodes layout functions, I changed the names slightly, for example:
node_composit_buts_color_matte -> node_composit_color_matte_layout

Since these nodes will probably move to their own namespaces and have their function names simplified anyway, I don't mind if that isn't done now.

The commit message should reflect my comment about the patch description.

This revision is now accepted and ready to land.Dec 15 2021, 8:10 PM

Since these nodes will probably move to their own namespaces and have their function names simplified anyway, I don't mind if that isn't done now.

Yeah, I didn't want to waste the time when all these functions will be remained to node_layout in the future.

  • Merge branch 'master' into arcpatch-D13523
  • Add missing include