The goal of this refactor is to reduce the amount of boilerplate code that is necessary to have a dynamic number of sockets on nodes. This is achieved by making the code more reusable. Currently, only the simulation and repeat zone nodes make use of this. However, even with just those two, the amount of code is reduced already. The benefit of this refactor will become even more significant as more nodes support a dynamic number of sockets. For example, the bake node and for-each zone will also benefit from this. We could probably make some of the utility functions non-templates using type erasure. This could reduce the compilation overhead when the number of nodes with item arrays increases. The main reason for why everything is templated now is that it made this refactor easier. Without this patch, all the code was essentially "manually templated". So the implementations look still similar to before now, just that concrete types are replaced with template parameters. No user-visible changes are expected. Pull Request: https://projects.blender.org/blender/blender/pulls/113114
13 lines
276 B
C++
13 lines
276 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "BKE_node.h"
|
|
|
|
extern bNodeTreeType *ntreeType_Geometry;
|
|
|
|
void register_node_tree_type_geo();
|
|
void register_node_type_geo_custom_group(bNodeType *ntype);
|