Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-02-16 22:06:18 +0300
committerHans Goudey <h.goudey@me.com>2021-02-16 22:06:18 +0300
commiteb2e260540439e75cd8fb74e9bb41d1e87213496 (patch)
treefd501b49b6df6d9acc9c08c5e4e34223caf3e478 /source/blender/nodes/intern/node_geometry_exec.cc
parentc075b8bff22073b890679855b3342a57640bfba4 (diff)
Cleanup: Used derived node in geometry exec params
Since the derived node tree is already build for the evaluation system, it's simpler to pass a derived node to the params struct. This will also allow context lookups in nested node groups for node error messages, since the derived node has that information readily accessible.
Diffstat (limited to 'source/blender/nodes/intern/node_geometry_exec.cc')
-rw-r--r--source/blender/nodes/intern/node_geometry_exec.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc
index 3de8209859b..7f4f75c294f 100644
--- a/source/blender/nodes/intern/node_geometry_exec.cc
+++ b/source/blender/nodes/intern/node_geometry_exec.cc
@@ -14,6 +14,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "NOD_derived_node_tree.hh"
#include "NOD_geometry_exec.hh"
#include "NOD_type_callbacks.hh"
@@ -23,12 +24,9 @@ namespace blender::nodes {
const bNodeSocket *GeoNodeExecParams::find_available_socket(const StringRef name) const
{
- LISTBASE_FOREACH (const bNodeSocket *, socket, &node_.inputs) {
- if ((socket->flag & SOCK_UNAVAIL) != 0) {
- continue;
- }
- if (name == socket->name) {
- return socket;
+ for (const DSocket *socket : node_.inputs()) {
+ if (socket->is_available() && socket->name() == name) {
+ return socket->bsocket();
}
}
@@ -144,18 +142,19 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier,
const CPPType *requested_type) const
{
bNodeSocket *found_socket = nullptr;
- LISTBASE_FOREACH (bNodeSocket *, socket, &node_.inputs) {
- if (identifier == socket->identifier) {
- found_socket = socket;
+ for (const DSocket *socket : node_.inputs()) {
+ if (socket->identifier() == identifier) {
+ found_socket = socket->bsocket();
break;
}
}
+
if (found_socket == nullptr) {
std::cout << "Did not find an input socket with the identifier '" << identifier << "'.\n";
std::cout << "Possible identifiers are: ";
- LISTBASE_FOREACH (bNodeSocket *, socket, &node_.inputs) {
- if ((socket->flag & SOCK_UNAVAIL) == 0) {
- std::cout << "'" << socket->identifier << "', ";
+ for (const DSocket *socket : node_.inputs()) {
+ if (socket->is_available()) {
+ std::cout << "'" << socket->identifier() << "', ";
}
}
std::cout << "\n";
@@ -185,18 +184,19 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier,
void GeoNodeExecParams::check_set_output(StringRef identifier, const CPPType &value_type) const
{
bNodeSocket *found_socket = nullptr;
- LISTBASE_FOREACH (bNodeSocket *, socket, &node_.outputs) {
- if (identifier == socket->identifier) {
- found_socket = socket;
+ for (const DSocket *socket : node_.outputs()) {
+ if (socket->identifier() == identifier) {
+ found_socket = socket->bsocket();
break;
}
}
+
if (found_socket == nullptr) {
std::cout << "Did not find an output socket with the identifier '" << identifier << "'.\n";
std::cout << "Possible identifiers are: ";
- LISTBASE_FOREACH (bNodeSocket *, socket, &node_.outputs) {
- if ((socket->flag & SOCK_UNAVAIL) == 0) {
- std::cout << "'" << socket->identifier << "', ";
+ for (const DSocket *socket : node_.outputs()) {
+ if (socket->is_available()) {
+ std::cout << "'" << socket->identifier() << "', ";
}
}
std::cout << "\n";