34 if (btree_cow ==
nullptr) {
48 if (socket->is_available() && socket->name() == name) {
49 return socket->bsocket();
60 const void *default_value)
const
62 const bNodeSocket *found_socket = this->find_available_socket(name);
64 if (found_socket ==
nullptr) {
65 return component.attribute_get_constant_for_read(domain,
type, default_value);
69 const std::string name = this->get_input<std::string>(found_socket->
identifier);
79 if (!name.empty() &&
component.attribute_domain_size(domain) != 0) {
81 TIP_(
"No attribute with name \"") + name +
"\"");
83 return component.attribute_get_constant_for_read(domain,
type, default_value);
86 const float value = this->get_input<float>(found_socket->
identifier);
87 return component.attribute_get_constant_for_read_converted(
92 return component.attribute_get_constant_for_read_converted(
97 return component.attribute_get_constant_for_read_converted(
101 return component.attribute_get_constant_for_read(domain,
type, default_value);
109 const bNodeSocket *found_socket = this->find_available_socket(name);
111 if (found_socket ==
nullptr) {
116 const std::string name = this->get_input<std::string>(found_socket->
identifier);
121 return attribute->custom_data_type();
151 for (
const std::string &name :
names) {
152 const bNodeSocket *found_socket = this->find_available_socket(name);
154 if (found_socket ==
nullptr) {
159 const std::string name = this->get_input<std::string>(found_socket->
identifier);
162 input_domains.
append(attribute->domain());
167 if (input_domains.
size() > 0) {
174 void GeoNodeExecParams::check_extract_input(
StringRef identifier,
175 const CPPType *requested_type)
const
179 if (socket->identifier() == identifier) {
180 found_socket = socket->bsocket();
185 if (found_socket ==
nullptr) {
186 std::cout <<
"Did not find an input socket with the identifier '" << identifier <<
"'.\n";
187 std::cout <<
"Possible identifiers are: ";
188 for (
const InputSocketRef *socket : node_->
inputs()) {
189 if (socket->is_available()) {
190 std::cout <<
"'" << socket->identifier() <<
"', ";
197 std::cout <<
"The socket corresponding to the identifier '" << identifier
198 <<
"' is disabled.\n";
201 else if (!input_values_.contains(identifier)) {
202 std::cout <<
"The identifier '" << identifier
203 <<
"' is valid, but there is no value for it anymore.\n";
204 std::cout <<
"Most likely it has been extracted before.\n";
207 else if (requested_type !=
nullptr) {
209 if (*requested_type != expected_type) {
210 std::cout <<
"The requested type '" << requested_type->
name() <<
"' is incorrect. Expected '"
211 << expected_type.name() <<
"'.\n";
217 void GeoNodeExecParams::check_set_output(StringRef identifier,
const CPPType &value_type)
const
220 for (
const OutputSocketRef *socket : node_->
outputs()) {
221 if (socket->identifier() == identifier) {
222 found_socket = socket->bsocket();
227 if (found_socket ==
nullptr) {
228 std::cout <<
"Did not find an output socket with the identifier '" << identifier <<
"'.\n";
229 std::cout <<
"Possible identifiers are: ";
230 for (
const OutputSocketRef *socket : node_->
outputs()) {
231 if (socket->is_available()) {
232 std::cout <<
"'" << socket->
identifier() <<
"', ";
239 std::cout <<
"The socket corresponding to the identifier '" << identifier
240 <<
"' is disabled.\n";
243 else if (output_values_.contains(identifier)) {
244 std::cout <<
"The identifier '" << identifier <<
"' has been set already.\n";
249 if (value_type != expected_type) {
250 std::cout <<
"The value type '" << value_type.name() <<
"' is incorrect. Expected '"
251 << expected_type.name() <<
"'.\n";
void BKE_nodetree_error_message_add(bNodeTree &ntree, const NodeTreeEvaluationContext &context, const bNode &node, const NodeWarningType type, std::string message)
static uint8 component(Color32 c, uint i)
struct ID * DEG_get_original_id(struct ID *id)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
static std::string default_domain
void append(const T &value)
StringRefNull name() const
AttributeDomain get_highest_priority_input_domain(Span< std::string > names, const GeometryComponent &component, const AttributeDomain default_domain) const
CustomDataType get_input_attribute_data_type(const StringRef name, const GeometryComponent &component, const CustomDataType default_type) const
ReadAttributePtr get_input_attribute(const StringRef name, const GeometryComponent &component, const AttributeDomain domain, const CustomDataType type, const void *default_value) const
void error_message_add(const NodeWarningType type, std::string message) const
Span< const InputSocketRef * > inputs() const
bNodeTree * btree() const
Span< const OutputSocketRef * > outputs() const
AttributeDomain attribute_domain_highest_priority(Span< AttributeDomain > domains)
std::unique_ptr< ReadAttribute > ReadAttributePtr
const CPPType * socket_cpp_type_get(const bNodeSocketType &stype)
struct SELECTID_Context context
struct bNodeSocketType * typeinfo