3
$\begingroup$

I have an example where I have the Scene Time output connected to the math node Fraction and the output of the Fraction node connected to the Factor attribute of the Sample Curve.

I am trying to understand how this works.

The output Seconds of Scene Time is by definition the current scene time. The current scene time is probably the elapsed time, which should be an increasing integer? What is the output of the Fraction node in this case?

$\endgroup$

1 Answer 1

4
$\begingroup$

The Scene Time node outputs the seconds as a float value at the Seconds output.

The Math node with the setting Fraction returns the decimal places of a float value.

To better explain Fraction, I'll assume a frame rate of 24fps, and present the values in tabular form:

Frame Seconds Fraction
48 2.0 (because ${48\over24} = 2$) 0.0
49 2.042 (because ${49\over24} = 2.041666...$) 0.042
50 2.083 (because ${50\over24} = 2.083333...$) 0.083
51 2.125 0.125
52 2.167 0.167
53 2.208 0.208
54 2.25 0.25
55 2.292 0.292
56 2.333 0.333
57 2.375 0.375
58 2.417 0.417
59 2.458 0.458
60 2.5 0.5
61 2.542 0.542
62 2.583 0.583
63 2.625 0.625
64 2.667 0.667
65 2.708 0.708
66 2.75 0.75
67 2.792 0.792
68 2.833 0.833
69 2.875 0.875
70 2.917 0.917
71 2.958 0.958
72 3.0 0.0

The table shows that the value for Seconds is interpolated depending on the selected frame rate.

And since Fraction always returns only the decimal places of that float value, logically you will always get a value between $0 - 1$ (However, it should be noted that strictly speaking you will get a value between $0-0.999...$, and this value can never be exactly $1$, because fraction of course only represents the decimal places):

And exactly this value can be used as Factor for curves or similar elements, which also always lies in the range $0 - 1$.

In this way, you can, for example, create a repetition in combination with the node Sample Curve, where a repetition occurs every second.

Another practical and simple example of use would be this one:

Trimming the end point of a spiral and repeating every two seconds Trimming the end point of a spiral and repeating every two seconds - Nodes
(Trimming the end point of a spiral and repeating every two seconds)

$\endgroup$
3
  • 1
    $\begingroup$ +1 for the next-level illustration :) $\endgroup$
    – Robin Betts
    Sep 2 at 9:12
  • 1
    $\begingroup$ Nice edit, just one small but: "The table shows that the value for Seconds is interpolated[…]" - what would the "interpolation" mean in this case? Also a number between 0 and 1 including 0 and excluding 1 can be described as a number in range $[0,1)$ but I'm always uncomfortable using this notation, not sure how many people could be confused by it. $\endgroup$ Sep 3 at 10:43
  • $\begingroup$ @MarkusvonBroady Thanks for the edit and clarification! ...your expertise is always welcome, and in the presentation of mathematical problems you are simply more advanced than I am. ;-) $\endgroup$
    – quellenform
    Sep 3 at 10:46

You must log in to answer this question.

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