Showing posts with label rename scope. Show all posts
Showing posts with label rename scope. Show all posts

Tuesday 10 March 2020

delaying per point.... using CHOPS

For some reason, the timeshift node doesn't work within For Loops. Eg. you have a bunch of points going from A to B and you want to offset each point by an arbitrary number of frames.

Matt Estella mentions -
The core issue is that the for-begin node doesn't split and cook the geo as you'd expect. Instead you have to set the begin node into 'fetch input', so it just grabs everything, then use a split sop to get the element you want, using the metadata node to read the value or iteration detail attribute.

To be honest, I don't really understand the problem & his example file doesn't quiiiiite do what I want. One of his other ones does though, albeit with a little tweaking. Bastian J Schiffer's video is very useful.
(https://vimeo.com/280537925)

At SOP level, make an integer point attribute called something like "timeshift" with some values. Make a null after this and call it TO_CHOPS


Then what we want to do is access a point attribute in CHOPS. The method isn't immediately obvious.
Make a chopnet, and two geometry nodes. Point them to TO_CHOPS  and make sure they're both "animated" and not "static. With the first one (geometry-transform), leave the default P, tx,ty,tz values... With the second (geometry-timeshift), set the Attribute scope to "timeshift" and the Rename scope to "timeshift" too.



Next make a channel wrangle. This behaves like a point wrangle, for the most part..there are, however, some CHOPS-only variables. Stick the geo-transform into input 1, and the geo-timeshift into input2.
Type this into the vex-box -

V=chinput(0,C, I+chinput(1,C,I));
"V" stands for value.
"chinput" is like the "point" function, but here it fetches channels instead of attributes. There're a few ways to use the function, but here we're going for the chinput(0,C,I) easy mode...

The first 0 is the 0th input (geo-transform), it fetches C, the channels (which are tx, ty, tz) and....
"I" is the index/iteration...we modify this by chinputting the geo-timeshift input and grabbing it's channels (the timeshift attribute)
Finally add a null, name it OUT (ignore the math/noise node for now, that's some other crap)
Jump up to SOP level and put a channel node to the TO_CHOPS, switch it to Animate mode. The default value of t[xyz] and P are fine here.

Your points should now be delayed....
You could make the delay a bit more fancy by adding a multiplier, either to the expression above, or in the bit where you define the timeshift attribute in the first place..