3DEqualizer Point from Intersect Script

I’ve been working on a simple script for locating a point based on the intersection of two lines. The use case is where you’re tracking a corner and it goes outside of frame or is obscured by something in the scene.

I was working a markerless shot where many of my points were corners of paving tiles, the scene also had foreground elements which frequently passed in front of these corners. I tried to figure out if the inaccuracy of guessing where they were was acceptable and realized a computer could “guess” them extremely accurately.

UseCase

It’s broken into two parts, one to automatically create reference points with the required naming system and one to do the calculation.

The procedure is to select the point you want to locate, run the Create points for intersection script, place the created points on lines which intersect your initial point (A1 & A2 on one line, B1 & B2 on the other), select your first point and run Update point from intersection.

example

If you want to repeat the procedure on additional frames just place the reference points again and repeat the Update point from intersection script.

To counter lens distortion the script will undistort the reference points, run the calculation and then redistort the resulting point so it’s ready for use in 3D calculation (the reference points are set to not calculate by default).

Planned future updates include the option of doing the process over a selected frame range, and maybe eventually a suite of tools for other geometric calculations involving ellipses, parallelograms etc.

Shoutout to Giovanni di Grezia (www.xgiovio.com) whose scripts I read to help learn the 3DE/Python interface.

Get it on Bitbucket here. Or on 3DEqualizer website here and here.

Fade Expressions in Nuke

Inspired by David Emney’s wave expressions for Nuke (https://davemne.wordpress.com/2011/05/16/nuke-wave-expressions-to-copy-and-paste/) I’ve compiled a handful of fade-in/out expressions.

All expressions return values from zero to one, to flip simply subtract them from 1, add/subtract/multiply/divide applied to the outermost level of the expression will allow tweaking the min/max values.

I’m not sure when these might be preferable to keyframe/curve based animation. At first I planned to multiply one against another expression to fade in a camera stabilize, I found that a more “art-directable” solution is to multiply the expression against a custom knob which you can animate as per usual.

Linear

Very straightforward

linear

clamp((frame-fadeStart)/(fadeEndfadeStart)

Slow-in Slow-Out

Clamping the frame range within an sine wave can give us a classic S curve. Let me know if you have a more elegant solution – this was mostly trial and error.

Sine

(sin(clamp(((frame-startFrame)*pi)/(endFramestartFrame) – pi/2 , -pi/2 , pi/2 ) )+1) /2

Slow-in Linear-Out

The next two are complementary halves of the sine expression.

SinLout

sin(clamp(((frame-startFrame)*pi)/((endFrame-startFrame)*2)-pi/2,-pi/2,0))+1

Linear-in Slow-Out

LinSout

sin(clamp(((frame-(startFrame*2-endFrame))*pi)/((endFramestartFrame)*2)-pi/2,0,pi/2))

 

 

I ended up not using these for what I originally planned so I’d be interested to hear if anyone does find a use for them.

– Ozols