Geometry Node: Multi-input socket tooltip #104468
|
@ -1 +1 @@
|
||||||
Subproject commit 4a581c54af9b92cb670d750951b9382160f10f3e
|
Subproject commit 8b4e4e9190467e0d71f200681681b9d67281d01d
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0b0052bd53ad8249ed07dfb87705c338af698bde
|
Subproject commit d4c8ec5cdff2337c34838b2ff83108697e1d4abe
|
|
@ -1 +1 @@
|
||||||
Subproject commit 96143b1a8b037ea3c81f065f557025db9fe1ace3
|
Subproject commit bdcfdd47ec3451822b21d1cff2ea2db751093c9a
|
|
@ -1039,32 +1039,42 @@ static std::optional<std::string> create_socket_inspection_string(TreeDrawContex
|
||||||
}
|
}
|
||||||
|
|
||||||
tree_draw_ctx.geo_tree_log->ensure_socket_values();
|
tree_draw_ctx.geo_tree_log->ensure_socket_values();
|
||||||
ValueLog *value_log = tree_draw_ctx.geo_tree_log->find_socket_value_log(socket);
|
|
||||||
if (value_log == nullptr) {
|
bool newline = false;
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
if (const geo_log::GenericValueLog *generic_value_log =
|
tree_draw_ctx.geo_tree_log->socket_logs_callback(socket, [&](const ValueLog *value_log){
|
||||||
dynamic_cast<const geo_log::GenericValueLog *>(value_log)) {
|
if (newline){
|
||||||
create_inspection_string_for_generic_value(socket, generic_value_log->value, ss);
|
ss << "\n";
|
||||||
}
|
}
|
||||||
else if (const geo_log::FieldInfoLog *gfield_value_log =
|
if (value_log == nullptr) {
|
||||||
dynamic_cast<const geo_log::FieldInfoLog *>(value_log)) {
|
return;
|
||||||
create_inspection_string_for_field_info(socket, *gfield_value_log, ss);
|
}
|
||||||
}
|
|
||||||
else if (const geo_log::GeometryInfoLog *geo_value_log =
|
if (const geo_log::GenericValueLog *generic_value_log =
|
||||||
dynamic_cast<const geo_log::GeometryInfoLog *>(value_log)) {
|
dynamic_cast<const geo_log::GenericValueLog *>(value_log)) {
|
||||||
create_inspection_string_for_geometry_info(
|
create_inspection_string_for_generic_value(socket, generic_value_log->value, ss);
|
||||||
*geo_value_log,
|
}
|
||||||
ss,
|
else if (const geo_log::FieldInfoLog *gfield_value_log =
|
||||||
dynamic_cast<const nodes::decl::Geometry *>(socket.runtime->declaration));
|
dynamic_cast<const geo_log::FieldInfoLog *>(value_log)) {
|
||||||
}
|
create_inspection_string_for_field_info(socket, *gfield_value_log, ss);
|
||||||
|
}
|
||||||
|
else if (const geo_log::GeometryInfoLog *geo_value_log =
|
||||||
|
dynamic_cast<const geo_log::GeometryInfoLog *>(value_log)) {
|
||||||
|
create_inspection_string_for_geometry_info(
|
||||||
|
*geo_value_log,
|
||||||
|
ss,
|
||||||
|
dynamic_cast<const nodes::decl::Geometry *>(socket.runtime->declaration));
|
||||||
|
}
|
||||||
|
newline = true;
|
||||||
|
});
|
||||||
|
|
||||||
std::string str = ss.str();
|
std::string str = ss.str();
|
||||||
if (str.empty()) {
|
|
||||||
return std::nullopt;
|
if (!str.empty()){
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
return str;
|
|
||||||
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool node_socket_has_tooltip(const bNodeTree &ntree, const bNodeSocket &socket)
|
static bool node_socket_has_tooltip(const bNodeTree &ntree, const bNodeSocket &socket)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "BLI_enumerable_thread_specific.hh"
|
#include "BLI_enumerable_thread_specific.hh"
|
||||||
#include "BLI_generic_pointer.hh"
|
#include "BLI_generic_pointer.hh"
|
||||||
mod_moder marked this conversation as resolved
Outdated
|
|||||||
#include "BLI_multi_value_map.hh"
|
#include "BLI_multi_value_map.hh"
|
||||||
|
#include "BLI_function_ref.hh"
|
||||||
|
|
||||||
#include "BKE_attribute.h"
|
#include "BKE_attribute.h"
|
||||||
#include "BKE_geometry_set.hh"
|
#include "BKE_geometry_set.hh"
|
||||||
|
@ -288,6 +289,7 @@ class GeoTreeLog {
|
||||||
void ensure_debug_messages();
|
void ensure_debug_messages();
|
||||||
|
|
||||||
ValueLog *find_socket_value_log(const bNodeSocket &query_socket);
|
ValueLog *find_socket_value_log(const bNodeSocket &query_socket);
|
||||||
|
void socket_logs_callback(const bNodeSocket &query_socket, FunctionRef<void(ValueLog *value_log)> callback);
|
||||||
};
|
};
|
||||||
mod_moder marked this conversation as resolved
Outdated
Hans Goudey
commented
I don't think this needs to be inline, it's not really a trivial function. I don't think this needs to be inline, it's not really a trivial function.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include "BKE_node_runtime.hh"
|
#include "BKE_node_runtime.hh"
|
||||||
#include "BKE_viewer_path.h"
|
#include "BKE_viewer_path.h"
|
||||||
|
|
||||||
|
#include "BLI_function_ref.hh"
|
||||||
|
|
||||||
#include "FN_field_cpp_type.hh"
|
#include "FN_field_cpp_type.hh"
|
||||||
|
|
||||||
#include "DNA_modifier_types.h"
|
#include "DNA_modifier_types.h"
|
||||||
|
@ -352,6 +354,17 @@ void GeoTreeLog::ensure_debug_messages()
|
||||||
reduced_debug_messages_ = true;
|
reduced_debug_messages_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeoTreeLog::socket_logs_callback(const bNodeSocket &query_socket, FunctionRef<void(ValueLog *value_log)> callback)
|
||||||
|
{
|
||||||
|
if (!query_socket.is_multi_input()){
|
||||||
|
callback(this->find_socket_value_log(query_socket));
|
||||||
|
}else{
|
||||||
|
for (const bNodeSocket *socket : query_socket.directly_linked_sockets()){
|
||||||
|
callback(this->find_socket_value_log(*socket));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ValueLog *GeoTreeLog::find_socket_value_log(const bNodeSocket &query_socket)
|
ValueLog *GeoTreeLog::find_socket_value_log(const bNodeSocket &query_socket)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9e33a8678a3b97d2fdb833349657c3cc1c04811f
|
Subproject commit fdfa2fcb9495d87571f2dfe2ae9fa0e032536600
|
Loading…
Reference in New Issue
Necessary to add this include?