Input video: format
Output SVG motion program code
Output SVG motion program
Input SVG motion program
MPTransformer(P, args):
// OBJECT SELECTOR: Select all objs.
selObjs = objSelector(P, propQuery, "all",
None, [0, P.endFrame])
// OBJECT TRANSFORMER: Pad each object
// timeline at the beginning for 4 seconds
// and add a random translational jitter.
linearRetimeObjTransformer(selObjs, 96, [0, 1])
function randomShakeX(t, [x, amp, freq]):
return x[t] + amp * sin(freq * t)
function randomShakeY(t, [y, amp, freq]):
return y[t] + amp * sin(freq * t)
motionTexObjTransformer(selObjs, randomShakeX,
[randFloat(),randFloat()],
[0, 96])
motionTexObjTransformer(selObjs, randomShakeY,
[randFloat(),randFloat()],
[0, 96])
Motion program transformer code. Here we pad the beginning of the video for 4 seconds with linearRetimeObjTransformer. We then fill that time with a random jitter motion texture to simulate an earthquake by using motionTexObjTransformer.
Output SVG motion program