[Bf-blender-cvs] [3dcb437d5ce] geometry-nodes-simulation: Remove elapsed time sockets

Hans Goudey noreply at git.blender.org
Sat Dec 10 07:01:25 CET 2022


Commit: 3dcb437d5ce48b6db1eb063248a5f3fb867059f2
Author: Hans Goudey
Date:   Fri Dec 9 17:11:05 2022 -0600
Branches: geometry-nodes-simulation
https://developer.blender.org/rB3dcb437d5ce48b6db1eb063248a5f3fb867059f2

Remove elapsed time sockets

Since this is theoretically redundant with simulating a float
with the delta time value, we decided to remove it for now to
make the whole interface simpler.

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

M	source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc
M	source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc b/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc
index 147fecc616a..c8c038b748b 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc
@@ -20,7 +20,6 @@ static void node_declare(NodeDeclarationBuilder &b)
   b.add_input<decl::Geometry>(N_("Geometry"));
 
   b.add_output<decl::Float>(N_("Delta Time"));
-  b.add_output<decl::Float>(N_("Elapsed Time"));
   b.add_output<decl::Geometry>(N_("Geometry"));
 }
 
@@ -84,15 +83,10 @@ static void node_geo_exec(GeoNodeExecParams params)
     return;
   }
 
-  const float elapsed_time = cache->is_empty() ? 0.0f : scene_ctime - cache->start_time()->time;
-  const float delta_time = cache->is_empty() ? 0.0f : scene_ctime - cache->last_run_time()->time;
-
   if (params.lazy_output_is_required("Delta Time")) {
+    const float delta_time = cache->is_empty() ? 0.0f : scene_ctime - cache->last_run_time()->time;
     params.set_output("Delta Time", delta_time);
   }
-  if (params.lazy_output_is_required("Elapsed Time")) {
-    params.set_output("Elapsed Time", elapsed_time);
-  }
 
   if (std::optional<GeometrySet> cached_value = cache->value_before_time("Geometry", time)) {
     if (params.lazy_output_is_required("Geometry")) {
diff --git a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
index 97ad87f9718..cdbdb4678c3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
@@ -21,7 +21,6 @@ static void node_declare(NodeDeclarationBuilder &b)
   b.add_input<decl::Geometry>(N_("Geometry"));
   b.add_output<decl::Bool>(N_("Started"));
   b.add_output<decl::Bool>(N_("Ended"));
-  b.add_output<decl::Float>(N_("Elapsed Time"));
   b.add_output<decl::Geometry>(N_("Geometry"));
 }
 
@@ -60,9 +59,6 @@ static void node_geo_exec(GeoNodeExecParams params)
   const bool started = !cache.is_empty();
   const bool ended = !cache.is_empty() && !run;
 
-  if (params.lazy_output_is_required("Elapsed Time")) {
-    params.set_output("Elapsed Time", elapsed_time);
-  }
   if (params.lazy_output_is_required("Started")) {
     params.set_output("Started", started);
   }



More information about the Bf-blender-cvs mailing list