1. A:レイヤー座標の基準点
const layer = thisComp.layer('tarLayer')
const tarPosition = layer.position - layer.anchorPoint
tarPosition
2. B:レイヤーの矩形BOX左上
= A + [ 矩形BOX.left , 矩形BOX.top ]
= 位置 - アンカーポイント + [ 矩形BOX.left , 矩形BOX.top ]
const layer = thisComp.layer('tarLayer')
const tarPosition = layer.position - layer.anchorPoint
const tarRect = layer.sourceRectAtTime(time + layer.inPoint)
const tarLeftTop = tarPosition + [tarRect.left, tarRect.top]
tarLeftTop
3. C:レイヤーの矩形BOX中央
= B + [ 矩形BOX.width /2, 矩形BOX.height /2 ]
= 位置 + アンカーポイント + [ 矩形BOX.left + 矩形BOX.width /2 , 矩形BOX.top + 矩形BOX.height /2 ]
const layer = thisComp.layer('tarLayer')
const tarPosition = layer.position - layer.anchorPoint
const tarRect = layer.sourceRectAtTime(time + layer.inPoint)
const tarCenter =
tarPosition +
[tarRect.left + tarRect.width / 2, tarRect.top + tarRect.height / 2]
tarCenter