Showing posts with label timeshift. Show all posts
Showing posts with label timeshift. Show all posts

Wednesday 31 March 2021

alternative to attribute interpolation, point specific?

This is quite a simple tip, but I always forget about it..

I had a a bunch of points that, over time, would get stretched out along the z axis. The stretching was dictated by a few random attributes, so it wasn't obvious which would end up the furthest away from the starting point.
Later it turned out I needed to adjust the pscale of each point, based on it's position. ie; the tip would be largest, the tail would be smallest.

So, timeshift and hold your points to the last frame. In a point vop, use a "relative to bounding box" node and get the delta vector. Output it to however it works for you - in my case I used a vector-to-float node to isolate the Z value and I called it pscale_z. Very original eh?

For whatever reason, I wasn't able to get attribute interpolation to work - I thought I could just plug in the moving points and the static end frame into the node, but the arrays and values just weren't working for me.. Leave a comment if you know how to get it working! (it does work for scatters and primitives, as the sourceprim and uv get created for you...)

Anyway, my work around was to use a point wrangle. Plug the moving points into the first input (0), and the static points with the pscale_z attributes into the second input (1).

f@pscale_z=point(1,"pscale_z",@ptnum);

 that's it! The moving points will now take the pscale_z attribute from input "1" . As long as you don't mess around with point numbers, this will keep working. (or if you do need to do that, I guess, give it an @id value somehow)

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..

Friday 21 February 2020

time shifting copy stamps

Needed to time offset an alembic which was being copy-to-points.
The methodology is the same as a previously posted thing, but the copy-to-points node needs to be situated inside the For Each loop



if you squint, you'll see there's an attribrandomize node. I've made an integer attribute called TimeOffset and ..randomised it..
In the timeshift node, I make a spare input and point it to ../PT, which holds said TimeOffset values

The value for the timeshift is : $FF+point(-1, 0, "timeOffset", 0)

so, we take the current frame and add the individual time offset value to it.

Shweet.

Thursday 12 April 2018

Quick note about Houdini hair

when using Houdini's toolbar hair tools, pay attention to the highest-level node's parameters.
The groom should take place on a static mesh (laydown a timeshift node), and the deform node will do the movement magic.