Geometry Nodes: pass depsgraph to nodes during execution

The depsgraph will have to be accessed in an upcoming patch.
This commit is contained in:
2021-01-19 16:58:05 +01:00
parent d60b128274
commit 9a32c7130b
2 changed files with 20 additions and 6 deletions

View File

@@ -24,6 +24,8 @@
#include "DNA_node_types.h"
struct Depsgraph;
namespace blender::nodes {
using bke::BooleanReadAttribute;
@@ -54,18 +56,21 @@ class GeoNodeExecParams {
GValueMap<StringRef> &output_values_;
const PersistentDataHandleMap &handle_map_;
const Object *self_object_;
Depsgraph *depsgraph_;
public:
GeoNodeExecParams(const bNode &node,
GValueMap<StringRef> &input_values,
GValueMap<StringRef> &output_values,
const PersistentDataHandleMap &handle_map,
const Object *self_object)
const Object *self_object,
Depsgraph *depsgraph)
: node_(node),
input_values_(input_values),
output_values_(output_values),
handle_map_(handle_map),
self_object_(self_object)
self_object_(self_object),
depsgraph_(depsgraph)
{
}
@@ -163,6 +168,11 @@ class GeoNodeExecParams {
return self_object_;
}
Depsgraph *depsgraph() const
{
return depsgraph_;
}
/**
* Creates a read-only attribute based on node inputs. The method automatically detects which
* input with the given name is available.