Return-Path: Received: from qmta01.emeryville.ca.mail.comcast.net ([76.96.30.16] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5286155 for ae-list@media-motion.tv; Fri, 15 Nov 2013 01:12:40 +0100 Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta01.emeryville.ca.mail.comcast.net with comcast id paD71m0051HpZEsA1cEWNQ; Fri, 15 Nov 2013 00:14:30 +0000 Received: from HPZ200 ([24.10.59.135]) by omta14.emeryville.ca.mail.comcast.net with comcast id pcEV1m00L2v3gNo8acEVEv; Fri, 15 Nov 2013 00:14:30 +0000 Message-ID: <622DC5D5E44E4DB9BF8F97CD31AF70C0@HPZ200> From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] expressions: parent/move layer based on proximity? Date: Thu, 14 Nov 2013 16:14:30 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_011C_01CEE154.992D5330" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1384474470; bh=BPmtVM4UjKodai/o5cnpiyRlficP+wL0/ZDzggZToCs=; h=Received:Received:Message-ID:From:To:Subject:Date:MIME-Version: Content-Type; b=bQ+j+/+SDx/L+j2xva0fWPa07WfJ/qmOSA3tTBVjtUKAMxd028pGHAVsWm9t/DF9B AX+c2KvglPWeCXdTu9pXM5pFYeCxiKedvexynx/QQ4iTysRrYdWg4RRVKE7z7co01u sMi/oA1c29OuOC0rLv8N7jsUmywAIR7VJjhdDFrlisxuCG1frXxs64sbDJ2Fa8nHH6 xjBxLyldzx+d9EiGD5USS8gW3sYM4Zi1vRRMHIXbjPP8PBuARBlDIWYP8KvljMoeJO Kq+CxkjWWXAYNuXLJ/dDTDt9tzK8FC4obfRlpbJt3KyENE8wsNe4UrKt4H6IvfgQqM zfDdCGNSDWVHQ== This is a multi-part message in MIME format. ------=_NextPart_000_011C_01CEE154.992D5330 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think your combo expression simplifies to something like this: p1=3DthisLayer.position; p2=3DthisComp.layer("drag me").position; distance=3Dlength(p1,p2); n =3D linear(distance, 0, 40,20, 0); value + (p2 - p2.valueAtTime(0))*n But I don=E2=80=99t think it=E2=80=99s going to behave the way you want, = based on your link. Dan From: scott.aelist=20 Sent: Thursday, November 14, 2013 3:41 PM To: After Effects Mail List=20 Subject: [AE] expressions: parent/move layer based on proximity? I'm trying to merge two expressions i've found, one that 'parents' a = layer's position to a master layer, and another that modulates a value = based on proximity. My goal is to have a master layer 'smear' the = position of child layers depending on how close they are. Sort of like = the way this AI tool works.=20 I believe the problem is in the syntax of the last three lines where I = try to combine the proximity value to the parenting. I get: ERROR: Class property has no method named value Any ideas what I'm doing wrong? // get proximity // // Point1 is current layer, point2 is control layer point1=3Dthis_layer.position; point2=3Dthis_comp.layer("drag me").position; // Find the vector between the 2 points delta=3Dsub(point1, point2); // Now find the length distance=3Dlength(delta); //Use linear() to remap distance to range of 40 to 0 n =3D linear(distance, 0, 40,20, 0); // parenting // myParent =3D thisComp.layer("drag me"); myProp =3D myParent.transform.position; // combine proximity and parenting // x =3D transform.position[0] + (myProp[0].value - = myProp[0].valueAtTime(0) * n); y =3D transform.position[1] + (myProp[1].value - = myProp[1].valueAtTime(0) * n); [x,y] ------=_NextPart_000_011C_01CEE154.992D5330 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think your combo expression simplifies to something like = this:
 
p1=3DthisLayer.position;
p2=3DthisComp.layer("drag me").position;
distance=3Dlength(p1,p2);
n =3D linear(distance, 0, 40,20, 0);
value + (p2 - p2.valueAtTime(0))*n
 
But I don=E2=80=99t think it=E2=80=99s going to behave the way you = want, based on your=20 link.
 
Dan
 
Sent: Thursday, November 14, 2013 3:41 PM
Subject: [AE] expressions: parent/move layer based on=20 proximity?
 
I'm trying to merge two expressions i've found, one that 'parents' = a=20 layer's position to a master layer, and another that modulates a value = based on=20 proximity. My goal is to have a master layer 'smear' the position of = child=20 layers depending on how close they are. Sort=20 of like the way this AI tool works.
I believe the problem = is in=20 the syntax of the last three lines where I try to combine the proximity = value to=20 the parenting.
I get: ERROR: Class property has no method named = value
Any ideas what I'm doing wrong?
 
// get proximity //
// Point1 is current layer, point2 is control=20 layer
point1=3Dthis_layer.position;
point2=3Dthis_comp.layer("drag = me").position;
// Find the vector between the 2 = points
delta=3Dsub(point1,=20 point2);
// Now find the length
distance=3Dlength(delta);
//Use = linear()=20 to remap distance to range of 40 to 0
n =3D linear(distance, 0, = 40,20,=20 0);

// parenting //
myParent =3D thisComp.layer("drag = me");
myProp =3D=20 myParent.transform.position;

// combine proximity and parenting //
x =3D transform.position[0] + (myProp[0].value - = myProp[0].valueAtTime(0) *=20 n);
y =3D transform.position[1] + (myProp[1].value - = myProp[1].valueAtTime(0) *=20 n);
[x,y]


 
------=_NextPart_000_011C_01CEE154.992D5330--