Maniphest T93098

Scene time input node
Closed, ResolvedTO DO

Assigned To
Johnny Matthews (guitargeek)
Authored By
Hans Goudey (HooglyBoogly)
Nov 15 2021, 6:44 PM
Tags
  • Geometry Nodes
Subscribers
Aaron Carlisle (Blendify)
Hans Goudey (HooglyBoogly)
Krusty Krustowski (Blendork)
Miro Horváth (dreamak)
Paul Larson (GeorgiaPacific)
Tokens
"Love" token, awarded by dreamak."Burninate" token, awarded by lopoIsaac."Love" token, awarded by HEYPictures."Love" token, awarded by mindinsomnia.

Description

Currently, to access the scene's time in geometry nodes, one has to use a #frame driver.
People have gotten used to doing this, but there is no particular reason it has to be complicated.

Instead, we should add a "Time" node that gives the current scene time, in frames and seconds.

Details

The node should have two single value outputs:

  • Frame The current scene frame
  • Seconds The current scene time in seconds (the name is the unit since there is no other way to make that clearly visible.

Implementation

Implementation wise the node itself should be fairly trivial. The more complex part is probably making the object reevaluate when the scene time changes.

  • To get the current time from the depsgraph use DEG_get_ctime(...).
  • To get the current depsgraph use GeoNodeExecParams::depsgraph().
  • In updateDepsgraph in MOD_nodes.cc, the node group has to be scanned for a Scene Time node, and if available a relation has to be added to the depsgraph. Maybe a new function next to DEG_add_node_tree_relation has to be added for that (e.g. DEG_add_scene_time_relation).

Further Questions

Node name: "Time" is a bit vague when there could possibly be other sources of time in the future-- simulation time, object time. So Scene Time might be a better more explicit name.

Revisions and Commits

rB Blender
D13455

Event Timeline

Hans Goudey (HooglyBoogly) renamed this task from Time input node to Scene time input node.Nov 15 2021, 6:44 PM
Hans Goudey (HooglyBoogly) changed the task status from Needs Triage to Confirmed.
Hans Goudey (HooglyBoogly) created this task.
Aaron Carlisle (Blendify) added a subscriber: Aaron Carlisle (Blendify).Nov 15 2021, 7:35 PM

Sounds good 👍🏻 a reminder to me or someone else to rename the compositor time node to "time curve node".

https://docs.blender.org/manual/en/latest/compositing/types/input/time.html

Paul Larson (GeorgiaPacific) added a subscriber: Paul Larson (GeorgiaPacific).Nov 15 2021, 9:58 PM
Aaron Carlisle (Blendify) added a comment.Nov 15 2021, 10:48 PM

Can we add the scene framerate also? This way we can easily calculate time in seconds (or any other unit) rather than in frames.

Hans Goudey (HooglyBoogly) added a comment.Nov 15 2021, 10:51 PM
In T93098#1254043, @Aaron Carlisle (Blendify) wrote:

This way we can easily calculate time in seconds (or any other unit) rather than in frames.

Isn't that what the seconds output is for though? Anyway, I don't really think framerate should be exposed that way, since it can be problematic if changing the framerate for rendering can change arbitrary things in some node tree.

Hans Goudey (HooglyBoogly) updated the task description.Nov 15 2021, 10:51 PM
Aaron Carlisle (Blendify) added a comment.Nov 15 2021, 10:55 PM

My bad I didn't see the seconds output, I thought there was only frames.

Mindinsomnia (mindinsomnia) awarded a token.Nov 16 2021, 9:06 AM
Jacques Lucke (JacquesLucke) updated the task description.Nov 30 2021, 4:16 PM
HEYPictures (HEYPictures) awarded a token.Nov 30 2021, 5:12 PM
Lopo Isaac (lopoIsaac) awarded a token.Dec 2 2021, 12:21 AM
Hans Goudey (HooglyBoogly) added a revision: D13455: Geometry Nodes: Scene Time Input Node.Dec 6 2021, 2:27 PM
Miro Horváth (dreamak) awarded a token.Dec 6 2021, 2:42 PM
Miro Horváth (dreamak) added a subscriber: Miro Horváth (dreamak).
Jacques Lucke (JacquesLucke) assigned this task to Johnny Matthews (guitargeek).Dec 7 2021, 7:17 PM
Johnny Matthews (guitargeek) added a commit: rBbd3bd776c893: Geometry Nodes: Scene Time Node.Dec 9 2021, 6:51 PM
Johnny Matthews (guitargeek) moved this task from Community Tasks to Done (waiting for product demo) on the Geometry Nodes board.Dec 9 2021, 7:32 PM
Krusty Krustowski (Blendork) added a subscriber: Krusty Krustowski (Blendork).EditedDec 15 2021, 8:52 AM

@Johnny Matthews (guitargeek) @Hans Goudey (HooglyBoogly) will this stay a Geometry Nodes exclusive? It would be useful in Shader Nodes too(like a few other GN exclusives)

Jacques Lucke (JacquesLucke) closed this task as Resolved.Dec 29 2021, 2:55 PM