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.
This commit is contained in:
Hans Goudey 2022-12-09 17:11:05 -06:00
parent ffe0db184a
commit 3dcb437d5c
2 changed files with 1 additions and 11 deletions

View File

@ -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")) {

View File

@ -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);
}