cactimurray
9/18/2019 - 11:20 AM

Cursor Hover

Currently alters 3D Z index when cursor object is hovering over the layer's bounds to effectively bring it to the foreground. Is currently independant of parenting and works with scrolling content with an independant cursor.

tl = thisLayer.toComp([0,0]);
br = thisLayer.toComp([width,height]);
t = thisLayer.transform.position;
var cur = thisComp.layer("↻ CURSOR").transform.position;
if ((cur[0] > tl[0]) && (cur[0] < br[0]) && (cur[1] > tl[1]) && (cur[1] < br[1])) {
	[t[0],t[1],-0.1]
} else {
	[t[0],t[1],t[2]]
}