6
$\begingroup$

I know that I can use key frames in various fields of the Geometry Nodes. But I want a more explicit reference of current frame number. The only thing I found is the 'Frame' layout to enclose nodes.

Is there a 'Frame' node which outputs the current frame number?

$\endgroup$
1
  • $\begingroup$ @Gorgious, thanks for your info. I'll look up more info on using driver. An explicit Frame/time node is the preferred way to show how an animation depends on frame/time explicitly and directly in the graph tree (with the help of other math nodes). For example: a simple animation that shows the size of a cube changes sinuously. Do you know if there is any plan for a simple Frame/time node? $\endgroup$ Commented Jul 24, 2021 at 20:05

3 Answers 3

10
$\begingroup$

FOR BLENDER VERSION > 3.1 : Refer to the other answer

I don't think there will be a node specifically designed to access the frame number. Although, like in the shader editor where this information is also sometimes needed, you can use a very simple driver to access the frame number directly.

Say you have this kind of setup and would like the Value node to output the frame number.

enter image description here

Left-Click in the value field like you would do if you wanted to input a new value, and type #frame. This will automatically create a driver (which can get a bit complicated if you want to go into the details, but in this case there is no need). This driver will have the same value as the current frame.

The field becomes purple to indicate it's now driven. To remove the driver, right click in the field and choose : Delete Driver.

enter image description here

Say you would want the value to increase more slowly. There are two methods to do it : Either tweak the driver (lesser solution) or add a math node afterwards (preferred solution, at least if you aren't really at ease with drivers).

Method 1 : You can add an operation after the frame driver.

enter image description here

Method 2 (better) : Use a math node. this gives you control over the multiplier and you can link it to the input node to directly tweak it into the modifier properties editor.

enter image description here

Tip : Use F2 or Right Click > Rename to rename the node to Frame.

enter image description here

$\endgroup$
4
  • $\begingroup$ I followed the steps and get the animation working! Thanks a lot for the details and clarity. Just out of curiosity, is there a hashmark for max-frame-number? I am thinking normalizing the animation speed. $\endgroup$ Commented Jul 24, 2021 at 20:42
  • 1
    $\begingroup$ @Shung-Ching it's the only global variable available by default AFAIK. docs.blender.org/manual/en/latest/animation/drivers/… You can add a key to the driver namespace docs.blender.org/manual/en/latest/animation/drivers/… and blender.stackexchange.com/questions/84391/… to permantently add it. Feel free to ask a new question if you're having trouble doing it :) $\endgroup$
    – Gorgious
    Commented Jul 25, 2021 at 9:03
  • 1
    $\begingroup$ I meant adding the frame_end property which is attributed to the current scene $\endgroup$
    – Gorgious
    Commented Jul 25, 2021 at 9:11
  • $\begingroup$ Thanks for the help again. It worked! $\endgroup$ Commented Jul 27, 2021 at 4:28
3
$\begingroup$

More modern answer (>= Blender 3.1; Released March 9th, 2022)

Blender 3.1 added the "Scene Time" node. It offers the current scene time in seconds and in frames (both as float values).

The "Scene Time" node in Blender

Link to the corresponding documentation: https://docs.blender.org/manual/en/latest/compositing/types/input/scene_time.html

$\endgroup$
3
$\begingroup$

For frame_end as mentioned here, there isn't a global variable for it. But most properties like this can be called in drivers using "Input Variables".

Making them manually is a bit slow, the fastest way is to RMB RMB the property you need > Copy As New Driver, then make a Value node, RMB RMB > Paste Driver.

enter image description here

You can use that node as is. But if you want to have that Input Variable in another driver, I.E. for use in a scripted expression, you can RMB RMB > Edit Driver, and from there you have buttons to copy/paste input variables.

I.E. If you want a driver to give frame_end - frame, you can do this:

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .