Copy link to clipboard
Copied
Hey,
this is the code not working:
anchorBefore = shapeLayer.transform.anchorPoint.value;
shapeLayer.transform.anchorPoint.expression = "layerBound=thisLayer.sourceRectAtTime(time);\nT=layerBound.top;\nL=layerBound.left;\nW=layerBound.width;\nH=layerBound.height;\n[L+W/2,T+H/2]";
anchorAfter = shapeLayer.transform.anchorPoint.value;
shapeLayer.transform.position.expression = "a = "+ anchorBefore +"-"+ anchorAfter +";\n[value[0]-a[0], value[1]-a[1]];";
it crashes at this line of code:
shapeLayer.transform.position.expression = "a = "+ anchorBefore +"-"+ anchorAfter +";\n[value[0]-a[0], value[1]-a[1]];";
if I just do something like that it works tho:
shapeLayer.transform.position.expression = "[1920, 1080]";
Thanks in advance,
RedyMotion
Copy link to clipboard
Copied
Forgot to mention but the variable "a" is defined higher in the code, that's not the problem since if I erase the part after the \n it still doesn't work