-
Position of Comp to 'Offset' (or index) position of text animator
I’m wanting to position a precomp at a specific location…at the end of a text layer, as the text layer types on.
I’ve managed to get the core functionality working…but I’d like the movement of the precomp to be effectively keyframes, not smoothly animating from one end to the other. The text types on with an opacity animator
<i style=””>Question 2: if I reference the offset of the animator using percentage, it’s fine, if I reference using index, it breaks
Code is below, but I’d appreciate assistance nutting an effective approach out.
I’m sure it’s possible.
controlLayer = effect("Typing Connection")("Layer").index;
xPos = thisComp.layer(controlLayer).transform.position[0];
yPos = thisComp.layer(controlLayer).transform.position[1];
animationDriver = thisComp.layer(controlLayer).text.animator("Type").selector("Range Selector 1").offset;
textWidth = thisComp.layer(controlLayer).sourceRectAtTime().width
textStart = animationDriver.key(1).time;
textFinish = animationDriver.key(animationDriver.numKeys).time;
typePos = linear(time, textStart, textFinish, xPos, xPos+textWidth);
[typePos, yPos]