diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2021-08-22 19:05:30 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2021-08-22 19:05:30 +0300 |
commit | 4af555a0311665f8b45d69ac5fffb6ba0243df28 (patch) | |
tree | 6d0779fe0cf1515353a3fcda93eac1de94fa2efc /source/blender/nodes/function/nodes/node_fn_boolean_math.cc | |
parent | 721fad37a1981a564404b5f708a405503dc18f45 (diff) |
Utility classes for compact node definitions in C++.
Node definitions in C++ are currently spread out over a large number of
files all over the code base (nodes, DNA, RNA, UI). By contrast, python
nodes are very compact and can be added much more easily. To make node
definitions in C++ more convenient, this patch adds some utility
functions that allow defining type properties and callbacks of a node
in a single file.
The NodeDefinition template takes a struct (which should usually also be
a child class of the template) and finds static fields and functions of
the template argument to use for the node type. The "Mesh Primitive
Ellipse" node has been added as an example case, it may not end up being
used. Other existing node types are unaffected, this patch only provides
alternative ways to define a node.
Known limitations:
- Only ID properties can be added in the node source files without
additional DNA structs. This should be sufficient for the vast
majority of nodes, but can be augmented with conventional DNA structs
in node->storage if necessary.
- Runtime node definitions are identified only by their idname, they do
not have a fixed integer type. This has to be taken into account for
versioning.
- Sockets are currently added in the init function. The "template"
system is not supported and a better alternative should be added
eventually.
Diffstat (limited to 'source/blender/nodes/function/nodes/node_fn_boolean_math.cc')
0 files changed, 0 insertions, 0 deletions