3
$\begingroup$

I'm having trouble looping an animation on a trim curve for a spline with geo nodes. I basically want the end of the trim to go from 1 to 0, then wait (a little delay) for the start to go for 0 to 1, so it looks like a segment is moving. Eventually, I'll apply this for multiple splines all moving at their random speed. (but I think I can manage to do that). I keep trying and no success. I think I don't master math and modulo enough.

Like in this example: https://i.stack.imgur.com/RBNuf.jpg

$\endgroup$
2
  • $\begingroup$ Hello and welcome. Instead of having users go through links and external sites please use the builtin tools to embed images in your post. See How to upload an image to a post? or GIFs $\endgroup$ Mar 15, 2022 at 22:09
  • $\begingroup$ @DuarteFarrajotaRamos sorry about that, I wanted to post a video and didn’t think the builtin tools would have permit that. $\endgroup$ Mar 16, 2022 at 0:01

2 Answers 2

2
$\begingroup$

with this node setup:

enter image description here

you will get this:

enter image description here

I did a bit commenting about the math in the nodes.

I think the green nodes are easy to understand, the tricky part might be the math. The frame will be divided by 100. So the output of the divide will be 0.01, 0.02, 0.03 and so on. The fraction results just the decimals, so the value will never be 1.01, 1.02 but instead 0.01, 0.02. After that the interval will be extended by 1.3 so i have values now from 0 to 1.3 (ok 1.3 * 0.99 exactly) instead of 0 to 0.99. Then the length of the animated curve will be subtracted to define the start value of the trim curve (which can be from 0 to 1, that's why we subtract that 0.3 again to get the 0 at frame 0 (because we lengthen the interval before by 0.3 by multiplying it with 1.3). Now we just add the 0.3 again (the length of the curve) to set the end value. Easy right? ;)

$\endgroup$
1
  • $\begingroup$ Oh wow, I'm not quite sure I understand the idea behind all of the math, but will try to integrate that and create a node group out of it. Thnaks ! $\endgroup$ Mar 16, 2022 at 12:58
0
$\begingroup$

many ways to do it, but to offset in time the 'end' animation just add some value...
is that what you asked?

enter image description here

sorry, had to edit because the image was not clear... here's a little more complex version of same nodes, again it could be done in other ways, maybe show what you already have..? to offset the 'ending' just add some value to 'start' animation, to animate different splines just use their index to add some extra offset... I used a map range node to avoid calculations, but you were using pure math and modulo? may be some some better answers around already, didn't search

$\endgroup$
2
  • $\begingroup$ Thanks ! I think I managed to make it loop by inserting a modulo between the map range and the scene time, set to the max + the delay in the add node. $\endgroup$ Mar 16, 2022 at 12:55
  • $\begingroup$ nice, had that example updated with exactly the same idea $\endgroup$
    – alambre
    Mar 16, 2022 at 13:49

You must log in to answer this question.

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