Page MenuHome

Nodes: Move node registration to nodes module.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Nov 25 2022, 1:36 PM.

Details

Summary

The main goal here is to move towards more self contained node definitions. Previously, one would have to change blenkernel to add a new node which is not necessary anymore. There is no need for all these register functions to "leak out" of the nodes module.

Diff Detail

Repository
rB Blender
Branch
register-nodes-refactor (branched from master)
Build Status
Buildable 24823
Build 24823: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Nov 25 2022, 1:36 PM
Jacques Lucke (JacquesLucke) created this revision.
Jacques Lucke (JacquesLucke) retitled this revision from Nodes: Move node registration to nodes module. to Nodes: Move node and socket registration to nodes module..Nov 25 2022, 1:45 PM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 25 2022, 4:08 PM

Big picture I think this is an improvement.

Looking at the current code, ED_init_standard_node_socket_type is called from nodes rather then blenkernel, so the patch description isn't quite right.
I wonder if you could expand the description to briefly describe how the modules are supposed to depend on each other.
AFAIK, theoretically nodes is supposed to live on top of blenkernel, so the kernel shouldn't call any functions from nodes. And editors is supposed to live on top of that.
We're pretty far away from that right now, though this patch gets us a bit closer.

Jacques Lucke (JacquesLucke) planned changes to this revision.Nov 25 2022, 5:20 PM

Looking at the current code, ED_init_standard_node_socket_type is called from nodes rather then blenkernel, so the patch description isn't quite right.

Oh right, I kind of got this mixed up. Will move the socket stuff back to where it was.

I wonder if you could expand the description to briefly describe how the modules are supposed to depend on each other. AFAIK, theoretically nodes is supposed to live on top of blenkernel, so the kernel shouldn't call any functions from nodes. And editors is supposed to live on top of that.

Yeah, it's not totally clear whether the "node system" (as opposed to the individual nodes) should live in blenkernel or nodes or somewhere else. What I am quite sure about is that actual nodes implementations should be able to depend on APIs provided by the editors module. Also, the editors module has to be able to depend on node APIs. The editors module should generally not depend on knowing about individual nodes, but it's hard to say where node specific operators should live...

My next goal is to put the new API from D16596: Nodes: Refactor how socket positions are determined. (WIP) into ED_node.hh which is included by individual nodes, so that they can tell the editors module how they want to be drawn.

Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
  • Merge branch 'master' into register-nodes-refactor
  • move socket registration back
This revision is now accepted and ready to land.Nov 25 2022, 5:25 PM
Jacques Lucke (JacquesLucke) retitled this revision from Nodes: Move node and socket registration to nodes module. to Nodes: Move node registration to nodes module..Nov 25 2022, 5:27 PM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)