[Bf-blender-cvs] [cdd045d2692] temp-geometry-nodes-evaluator-refactor: cleanup logging

Jacques Lucke noreply at git.blender.org
Wed Sep 7 13:02:56 CEST 2022


Commit: cdd045d26929d42edfff031541b0ea4fe31e6f99
Author: Jacques Lucke
Date:   Wed Sep 7 11:06:24 2022 +0200
Branches: temp-geometry-nodes-evaluator-refactor
https://developer.blender.org/rBcdd045d26929d42edfff031541b0ea4fe31e6f99

cleanup logging

===================================================================

M	source/blender/editors/space_node/node_draw.cc
M	source/blender/editors/space_node/node_geometry_attribute_search.cc
M	source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/nodes/NOD_geometry_nodes_log.hh
M	source/blender/nodes/intern/geometry_nodes_log.cc

===================================================================

diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 3d5be298a31..f6b6d217fbd 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -503,25 +503,16 @@ static void create_inspection_string_for_generic_value(const GPointer value, std
   }
 }
 
-static void create_inspection_string_for_gfield(const geo_log::GFieldValueLog &value_log,
-                                                std::stringstream &ss)
+static void create_inspection_string_for_field_info(const geo_log::FieldInfoLog &value_log,
+                                                    std::stringstream &ss)
 {
   const CPPType &type = value_log.type;
-  const GField &field = value_log.field;
   const Span<std::string> input_tooltips = value_log.input_tooltips;
 
   if (input_tooltips.is_empty()) {
-    if (field) {
-      BUFFER_FOR_CPP_TYPE_VALUE(type, buffer);
-      blender::fn::evaluate_constant_field(field, buffer);
-      create_inspection_string_for_generic_value({type, buffer}, ss);
-      type.destruct(buffer);
-    }
-    else {
-      /* Constant values should always be logged. */
-      BLI_assert_unreachable();
-      ss << "Value has not been logged";
-    }
+    /* Should have been logged as constant value. */
+    BLI_assert_unreachable();
+    ss << "Value has not been logged";
   }
   else {
     if (type.is<int>()) {
@@ -554,9 +545,9 @@ static void create_inspection_string_for_gfield(const geo_log::GFieldValueLog &v
   }
 }
 
-static void create_inspection_string_for_geometry(const geo_log::GeometryValueLog &value_log,
-                                                  std::stringstream &ss,
-                                                  const nodes::decl::Geometry *socket_decl)
+static void create_inspection_string_for_geometry_info(const geo_log::GeometryInfoLog &value_log,
+                                                       std::stringstream &ss,
+                                                       const nodes::decl::Geometry *socket_decl)
 {
   Span<GeometryComponentType> component_types = value_log.component_types;
   if (component_types.is_empty()) {
@@ -575,7 +566,7 @@ static void create_inspection_string_for_geometry(const geo_log::GeometryValueLo
     const char *line_end = (type == component_types.last()) ? "" : ".\n";
     switch (type) {
       case GEO_COMPONENT_TYPE_MESH: {
-        const geo_log::GeometryValueLog::MeshInfo &mesh_info = *value_log.mesh_info;
+        const geo_log::GeometryInfoLog::MeshInfo &mesh_info = *value_log.mesh_info;
         char line[256];
         BLI_snprintf(line,
                      sizeof(line),
@@ -587,7 +578,7 @@ static void create_inspection_string_for_geometry(const geo_log::GeometryValueLo
         break;
       }
       case GEO_COMPONENT_TYPE_POINT_CLOUD: {
-        const geo_log::GeometryValueLog::PointCloudInfo &pointcloud_info =
+        const geo_log::GeometryInfoLog::PointCloudInfo &pointcloud_info =
             *value_log.pointcloud_info;
         char line[256];
         BLI_snprintf(line,
@@ -598,7 +589,7 @@ static void create_inspection_string_for_geometry(const geo_log::GeometryValueLo
         break;
       }
       case GEO_COMPONENT_TYPE_CURVE: {
-        const geo_log::GeometryValueLog::CurveInfo &curve_info = *value_log.curve_info;
+        const geo_log::GeometryInfoLog::CurveInfo &curve_info = *value_log.curve_info;
         char line[256];
         BLI_snprintf(line,
                      sizeof(line),
@@ -608,7 +599,7 @@ static void create_inspection_string_for_geometry(const geo_log::GeometryValueLo
         break;
       }
       case GEO_COMPONENT_TYPE_INSTANCES: {
-        const geo_log::GeometryValueLog::InstancesInfo &instances_info = *value_log.instances_info;
+        const geo_log::GeometryInfoLog::InstancesInfo &instances_info = *value_log.instances_info;
         char line[256];
         BLI_snprintf(line,
                      sizeof(line),
@@ -623,7 +614,7 @@ static void create_inspection_string_for_geometry(const geo_log::GeometryValueLo
       }
       case GEO_COMPONENT_TYPE_EDIT: {
         if (value_log.edit_data_info.has_value()) {
-          const geo_log::GeometryValueLog::EditDataInfo &edit_info = *value_log.edit_data_info;
+          const geo_log::GeometryInfoLog::EditDataInfo &edit_info = *value_log.edit_data_info;
           char line[256];
           BLI_snprintf(line,
                        sizeof(line),
@@ -693,13 +684,13 @@ static std::optional<std::string> create_socket_inspection_string(TreeDrawContex
           dynamic_cast<const geo_log::GenericValueLog *>(value_log)) {
     create_inspection_string_for_generic_value(generic_value_log->value, ss);
   }
-  else if (const geo_log::GFieldValueLog *gfield_value_log =
-               dynamic_cast<const geo_log::GFieldValueLog *>(value_log)) {
-    create_inspection_string_for_gfield(*gfield_value_log, ss);
+  else if (const geo_log::FieldInfoLog *gfield_value_log =
+               dynamic_cast<const geo_log::FieldInfoLog *>(value_log)) {
+    create_inspection_string_for_field_info(*gfield_value_log, ss);
   }
-  else if (const geo_log::GeometryValueLog *geo_value_log =
-               dynamic_cast<const geo_log::GeometryValueLog *>(value_log)) {
-    create_inspection_string_for_geometry(
+  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));
diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc
index 33e0b652279..f63adefa5f6 100644
--- a/source/blender/editors/space_node/node_geometry_attribute_search.cc
+++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc
@@ -78,8 +78,8 @@ static Vector<const GeometryAttributeInfo *> get_attribute_info_from_context(
     // tree_log->foreach_node_log([&](const geo_log::NodeLog &node_log) {
     //   for (const geo_log::SocketLog &socket_log : node_log.input_logs()) {
     //     const geo_log::ValueLog *value_log = socket_log.value();
-    //     if (const geo_log::GeometryValueLog *geo_value_log =
-    //             dynamic_cast<const geo_log::GeometryValueLog *>(value_log)) {
+    //     if (const geo_log::GeometryInfoLog *geo_value_log =
+    //             dynamic_cast<const geo_log::GeometryInfoLog *>(value_log)) {
     //       for (const GeometryAttributeInfo &attribute : geo_value_log->attributes()) {
     //         if (bke::allow_procedural_attribute_access(attribute.name)) {
     //           if (names.add(attribute.name)) {
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 1c060d1f96f..5c4d50d74b9 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -468,8 +468,8 @@ GeometrySet spreadsheet_get_display_geometry_set(const SpaceSpreadsheet *sspread
         //     geo_log::ModifierLog::find_node_by_spreadsheet_editor_context(*sspreadsheet);
         // if (node_log != nullptr) {
         //   for (const geo_log::SocketLog &input_log : node_log->input_logs()) {
-        //     if (const geo_log::GeometryValueLog *geo_value_log =
-        //             dynamic_cast<const geo_log::GeometryValueLog *>(input_log.value())) {
+        //     if (const geo_log::GeometryInfoLog *geo_value_log =
+        //             dynamic_cast<const geo_log::GeometryInfoLog *>(input_log.value())) {
         //       const GeometrySet *full_geometry = geo_value_log->full_geometry();
         //       if (full_geometry != nullptr) {
         //         geometry_set = *full_geometry;
@@ -505,8 +505,8 @@ static void find_fields_to_evaluate(const SpaceSpreadsheet *sspreadsheet,
   //   if (value_log == nullptr) {
   //     continue;
   //   }
-  //   if (const geo_log::GFieldValueLog *field_value_log =
-  //           dynamic_cast<const geo_log::GFieldValueLog *>(value_log)) {
+  //   if (const geo_log::FieldInfoLog *field_value_log =
+  //           dynamic_cast<const geo_log::FieldInfoLog *>(value_log)) {
   //     const GField &field = field_value_log->field();
   //     if (field) {
   //       r_fields.add("Viewer", std::move(field));
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 5f37257aa99..ab62255d0c7 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -1407,7 +1407,7 @@ static void attribute_search_update_fn(
   // if (modifier_log == nullptr) {
   //   return;
   // }
-  // const geo_log::GeometryValueLog *geometry_log = data.is_output ?
+  // const geo_log::GeometryInfoLog *geometry_log = data.is_output ?
   //                                                     modifier_log->output_geometry_log() :
   //                                                     modifier_log->input_geometry_log();
   // if (geometry_log == nullptr) {
diff --git a/source/blender/nodes/NOD_geometry_nodes_log.hh b/source/blender/nodes/NOD_geometry_nodes_log.hh
index 3e9954e1090..2b07021ce3c 100644
--- a/source/blender/nodes/NOD_geometry_nodes_log.hh
+++ b/source/blender/nodes/NOD_geometry_nodes_log.hh
@@ -58,13 +58,12 @@ class GenericValueLog : public ValueLog {
   }
 };
 
-class GFieldValueLog : public ValueLog {
+class FieldInfoLog : public ValueLog {
  public:
-  GField field;
   const CPPType &type;
   Vector<std::string> input_tooltips;
 
-  GFieldValueLog(const GField &field, bool log_full_field);
+  FieldInfoLog(const GField &field);
 };
 
 struct GeometryAttributeInfo {
@@ -74,11 +73,10 @@ struct GeometryAttributeInfo {
   std::optional<eCustomDataType> data_type;
 };
 
-class GeometryValueLog : public ValueLog {
+class GeometryInfoLog : public ValueLog {
  public:
   Vector<GeometryAttributeInfo> attributes;
   Vector<GeometryComponentT

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list