Input video: filmRadio
Output SVG motion program code
Output SVG motion program
SVG motion program code (uncorrected tracking)
SVG motion program (uncorrected tracking)
Input SVG motion program
MPTransformer(P, args):
// OBJECT SELECTOR: Query for letters on the 1st, 3rd, 5th row
// in the last frame. positionX and positionY refer to X position and
// Y position and both range from 0 to 1.
// objSelector then returns objects whose positionY matches any number
// listed in the array [0.1, 0.5, 0.9].
selObjs = objSelector(P, propQuery, "positionY", [0.1, 0.5, 0.9],
[P.endFrm, P.endFrm])
// OBJECT TRANSFORMER: Add local textural skew motion to objects
// first define a function that returns a sinusoidal X shear
// motion ranges from -1 to 1 with frequency freq.
function shearXFn(obj, t, [freq]):
return 180 * sin(freq * t) + obj.shearX[t]
// Pass the shearXFn with freq = 24 to the motion texture object
// transformer and apply it to the full duration.
motionTexObjTransformer(selObjs, shearXFn, [24], [0, P.endFrm]):
Motion program transformer code. Here we add a X-shear motion texture to the characters on the first, third, and fifth row with motionTexObjTransformer.
Output SVG motion program
Input SVG motion program
MPTransformer(P, freq, [0, P.endFrm]):
// OBJECT SELECTOR: Query for letters on the 1st, 3rd, 5th row
// in the last frame. positionX and positionY refer to X position and
// Y position and both range from 0 to 1.
// objSelector then returns objects whose positionY matches any number
// listed in the array [0.1, 0.5, 0.9].
selObjs = objSelector(P, propQuery, "positionY", [0.1, 0.5, 0.9],
[P.endFrm, P.endFrm])
// OBJECT TRANSFORMER: Add local textural rotate motion to objects
// first define a function that returns a sinusoidal rotation
// motion ranges from -180 to 180 with frequency freq.
function rotateFn(obj, t, [freq]):
return 180 * sin(freq * t) + obj.r[t]
// Pass the rotateFn with freq = 24 to the motion texture object
// transformer and apply it to the full duration.
motionTexObjTransformer(selObjs, rotateFn, [24], [0, P.endFrm]):
Motion program transformer code. Here we add a rotational motion texture to the characters on the first, third, and fifth row with motionTexObjTransformer.
Output SVG motion program
Input SVG motion program
MPTransformer(P, args):
// OBJECT SELECTOR: Query for letters on the 2nd and 4th row
// in the last frame. positionX and positionY refer to X position and
// Y position and both range from 0 to 1.
// objSelector then returns objects whose positionY matches any number
// listed in the array [0.3, 0.7].
selObjs = objSelector(P, propQuery, "positionY", [0.3, 0.7],
[P.endFrm, P.endFrm])
// OBJECT TRANSFORMER: Change the appearance to green letters.
changeAppearanceObjTransformer(selObjs, ["F_g.png", "I_g.png",
"L_g.png", "M_g.png", "A_g.png",
"N_g.png", "D_g.png", "R_g.png",
"A_g.png", "D_g.png", "I_g.png",
"O_g.png"], [0, P.endFrm])
return transformedP
Motion program transformer code. Here we change the color of the characters on the second and fourth row to green with changeAppearanceObjTransformer.
Output SVG motion program
Input SVG motion program
MPTransformer(P, args):
// OBJECT SELECTOR: Query for all A, N, and D letters based on
// X positions in the last frame. positionX and positionY refer to
// X position and Y position and both range from 0 to 1.
// objSelector then returns objects whose positionX matches any number
// listed in the array [0.5, 0.6, 0.7].
selObjs = objSelector(P, propQuery, "positionX", [0.5, 0.6, 0.7],
[P.endFrm, P.endFrm])
// OBJECT TRANSFORMER: Change the appearance to icons.
changeAppearanceObjTransformer(selObjs, ["camera.png",
"popcorn.png", "radio.png"], [0, P.endFrm])
return transformedP
Motion program transformer code. Here we swap out the letters "A", "N", and "D" with icons related to film and radio with changeAppearanceObjTransformer.
Output SVG motion program