Cycle Carve SOP animation?

   1615   2   2
User Avatar
Member
408 posts
Joined: June 2015
Offline
I recall seeing an example some time ago of a procedural way to animate the FirtU and SecondU parameters of the Carvev SOP making it cycle/loop. I can't find that reference anymore, any idea what that expression would be please? (I am not referring to Matt's carving examples, which are awesome https://forums.odforce.net/topic/30668-randomize-carve-animation [forums.odforce.net] , because those are ping-pong-ing and i need to cycle/loop instead)

To be more precise, what it should do, what i'm trying to get, is it makes it look like a chunk of the curve is permanently sliding along its path and cycling.

Thanks in advance,

Cheers,

A.
Edited by Adriano - Sept. 4, 2019 16:46:45
User Avatar
Member
26 posts
Joined: Aug. 2018
Offline
When you reach the end of the curve, you would probably want a second curve to appear. The following code does not take care of that, but it does loop your curve segment.

Put it into a Wrangle, set it to “detail”, and let the Carve SOP behind it reference detail(0, “first”, 0) and detail(0, “second”, 0)

float amount = @Frame / 100;

f@first = frac(amount);
f@second = frac(amount + 0.2);

if (f@second < f@first)
f@second += 1;
User Avatar
Member
3 posts
Joined: Oct. 2020
Offline
You can just right "frac(@Frame*.01)" in the First U input. Of course .01 is the speed. "frac" only keep the numbers after the coma, so it makes it cycle between 0 and 1.
  • Quick Links