Input video: lucy
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):
new_appearances = [
'data/misc30/chinese/nice.png',
'data/misc30/chinese/to.png',
'data/misc30/chinese/meet.png',
'data/misc30/chinese/you.png',
'data/misc30/chinese/Im.png',
'data/misc30/chinese/lucy.png',
]
wordObjs = objSelector(P, propQuery, "color", "black", [0, P.endFrm])
changeAppearanceObjTransformer(wordObjs, new_appearances)
Motion program transformer code. We use an changeAppearanceObjTransformer to translate this social media ad into Chinese.
Output SVG motion program
Input SVG motion program
MPTransformer(P, args):
// Change to french text.
new_appearances = [
'data/misc30/french/enchante.png',
'data/misc30/french/jesuis.png',
'data/misc30/french/lucy.png',
]
wordObjs = objSelector(P, propQuery, "color", "black", [0, P.endFrm])
changeAppearanceObjTransformer(wordObjs[-3:], new_appearances)
removeObjs(wordObjs[:-3])
// Positional adjustments.
function setX(t, [x, amt]):
return amt / 2
adjGlobalMotion(wordObjs[-3], setX, [obj.startFrm, obj.endFrm], amt=P.width / 2)
// Get the two objects in contact with it.
collisions = eventQuery(wordObjs[-3], "collisionFrames", [100, 200])
function containsID(id, id_list):
return id in id_list
id_list = {}
for collision in collisions:
id_list.add([obj.id for obj in collision])
contactObjs = objSelector(P, propQuery, "id", containsID, [0, P.endFrm], id_list=id_list)
function adjust_by(t, [y, amt]):
return amt
adjustLocalObjTransformer(
[wordObjs[-3], contactObjs[0], contactObjs[1]],
adjust_by, [wordObjs[-3].startFrm, P.endFrm], amt=-75)
// Readjust the two contact objects motions so that they float from
// their new starting position to their original ending position.
function global_interp(t, [y, start, end, length]):
if t < length:
return end * t / length + start * (1 - t / length)
else:
return end
for obj in contactObjs:
y_pos_start = propQuery(obj, "positionY", [0, wordObjs[-3].endFrm])[-1]
y_pos_end = minimum(propQuery(obj, "positionY", [obj.startFrm, obj.endFrm]))
adjGlobalMotion(obj, global_interp, [wordObj[-3].endFrm, obj.endFrm],
start=y_pos_start, end=y_pos_end, length=P.frame_rate)
Motion program transformer code. We use an changeAppearanceObjTransformer to translate this social media ad into French. A local motion adjustment is applied to the two circles which are held down by the text so that they collide with the new text.
Output SVG motion program