Friday, January 25, 2019

Houville :: Pivoting away from that annoying copy to points with N, "Oh it's sideways" nonsense

If you have cards scattered around and want to copy something useful in their place, this will rotate @N for you.
vector up = point(0,"P",0) - point(0,"P",1);
vector axis = point(0,"P",0) - point(0,"P",2);
@N = normalize(cross(up,axis));

Friday, December 14, 2018

Nuke: Cant believe I forgot this... First frame last frame

nuke.knob('root.first_frame')
nuke.knob('root.last_frame')
yup. I know. Oh and it returns a string btw. I have NO idea why. Like really. Why..?

Saturday, July 14, 2018

Houville :: Alembic transform theft

Now that I'm typing this I'll probably not forget it. If I don't post this, I'll definitely forget it.
//Alembic packed info put onto existing geo.
matrix abc = primintrinsic(1,'packedfulltransform',0);
P *= abc;


This is kind of messed up, but handy if you want to freeze geo, affect it, but then have it resume animation from an incoming abc transform animation. Input 1 is the frozen and tweaked geo, 2 is the animated abc and 3 is the abc frozen on the same frame as 1.
//Alembic packed info from static frame subtracted out, then a the animated one put back in/
matrix abc = primintrinsic(1,'packedfulltransform',0);
matrix abcRef = primintrinsic(2,'packedfulltransform',0);

P *= invert(abcRef) * abc;

Friday, June 29, 2018

Houville :: Looping RBD Sims



So the concept here was run a sim, reverse it and blend the two together so that the beginning and the end are the same.

Pretty logical right?

Well as you can see from the top gif, when the blend back occurred, chunks would squish through themselves to resolve the different orientations.

After a bit of messing around I realised rather than deal with the chunks, just keep the point data from the sim and use a for-each loop to copy each chunk back onto the corresponding point afterwards.  This resolved the squish but then there was a pop as the orientation attribute was not blended by the blendShape SOP.

The way around that was to use a wrangle that blended @P with a lerp, and then did exactly the same with the @orient attribute.

Plugging that in to the for-each copy chunks loop made everything work as expected :)