Showing posts with label bounding box. Show all posts
Showing posts with label bounding box. Show all posts

Wednesday 26 October 2022

using a transform that relies on $CEX $CEY $CEZ with a differently shaped/sized object

Use the julian matrix - (point wrangle)

matrix M=detail(1,"xform");

@P=@P*M;

plug the transform you want to "copy" into input 2 ("1") and the object you want to transform with said transform into input 1 ("0"). 

MAKE SURE the transform node has the xform ticked at the bottom, so the wrangle can actually access the "xform"

This is especially relevant for when you overuse $CEX etc bounding box for pivots & you suddenly change the geo size. Eg you rotate your thing into place, and do so using the centre of a short object, but suddenly you need to substitute it with a much taller thing.

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)