Geometry Nodes: Add animation start and end to scene time #104948

Closed
Miles Conway wants to merge 3 commits from Programmer123/blender:expanded-scene-time-node into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,8 @@ static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Float>(N_("Seconds"));
b.add_output<decl::Float>(N_("Frame"));
b.add_output<decl::Float>(N_("Start Frame"));
b.add_output<decl::Float>(N_("End Frame"));
}
static void node_exec(GeoNodeExecParams params)
@ -21,6 +23,8 @@ static void node_exec(GeoNodeExecParams params)
const double frame_rate = (double(scene->r.frs_sec) / double(scene->r.frs_sec_base));
params.set_output("Seconds", float(scene_ctime / frame_rate));
params.set_output("Frame", scene_ctime);
params.set_output("Start Frame", BKE_scene_frame_to_ctime(scene, scene->r.sfra));
params.set_output("End Frame", BKE_scene_frame_to_ctime(scene, scene->r.efra));
}
} // namespace blender::nodes::node_geo_input_scene_time_cc