Return-Path: Received: from mail-wi0-f171.google.com ([209.85.212.171] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5286168 for AE-List@media-motion.tv; Fri, 15 Nov 2013 01:45:28 +0100 Received: by mail-wi0-f171.google.com with SMTP id hn6so314468wib.4 for ; Thu, 14 Nov 2013 16:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=nBJjGkwcz4uNwm0F8U0S2MIy5RE/jKu2ptQ+3JPm7FM=; b=f4AERn7txY81/yxxJA2vJnYhWdhPYjgN1pC/NwXaxPK46IaU7p4tZZZXEpbdvOnl8c gYicmKXFHoyrKLAnZxG/6Bp/v5L+moyM0izGr4csRsQlYd3sqV5jGE1YNWVBsQF1Y+du FZ+lxbHO/tR+Tjy9hIwbcSb99NhR3By4b8tbeNl2XZeDWBmsb1f3JS2OujP4/DPOYPdM r9wiQlS9wtHivtyndtqGJkTbRm6cekmNg3XJGq8/R4xg0t4pA4DIBG57H0hIUb0tUlDS 6OP4ntDm/mxUHxsRKw9sN4ina4LxtDX1VTuk0JEpHXDTU5CxqAdaL4PK5DcHtHaz/lzv pAvQ== X-Received: by 10.180.211.212 with SMTP id ne20mr5391682wic.31.1384476439140; Thu, 14 Nov 2013 16:47:19 -0800 (PST) MIME-Version: 1.0 Sender: hedczech@gmail.com Received: by 10.217.106.136 with HTTP; Thu, 14 Nov 2013 16:46:39 -0800 (PST) In-Reply-To: References: From: "scott.aelist" Date: Thu, 14 Nov 2013 16:46:39 -0800 X-Google-Sender-Auth: M4SgUhRZJFp7yUMbQujMiqdfrM0 Message-ID: Subject: Re: [AE] expressions: parent/move layer based on proximity? To: After Effects Mail List Content-Type: multipart/alternative; boundary=001a11c38a885ae29f04eb2c8ac1 --001a11c38a885ae29f04eb2c8ac1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable ah yes. I forgot about that. Still thank you for correcting my code Dan. On Thu, Nov 14, 2013 at 4:14 PM, Dan Ebberts wrote: > 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=92t think it=92s going to behave the way you want, based on you= r > link. > > Dan > > *From:* scott.aelist > *Sent:* Thursday, November 14, 2013 3:41 PM > *To:* After Effects Mail List > *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 positio= n > of child layers depending on how close they are. Sort of like the way > this AI tool works. > > I believe the problem is in the syntax of the last three lines where I tr= y > 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] > > > > --001a11c38a885ae29f04eb2c8ac1 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
ah yes. I forgot about that. Still thank you for correctin= g my code Dan.


On Thu, Nov 14, 2013 at 4:14 PM, Dan Ebberts = <debberts@comc= ast.net> wrote:
I think your combo expression simplifies to something like this:
=A0
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
=A0
But I don=92t think it=92s going to behave the way you want, based on = your=20 link.
=A0
Dan
=A0
Sent: Thursday, November 14, 2013 3:41 PM
Subject: [AE] expressions: parent/move layer based on=20 proximity?
=A0
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 o= f 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 val= ue to=20 the parenting.
I get: ERROR: Class property has no method named=20 value
Any ideas what I'm doing wrong?
=A0
// get proximity //
// Point1 is current layer, point2 is control=20 layer
point1=3Dthis_layer.position;
point2=3Dthis_comp.layer("dr= ag=20 me").position;
// Find the vector between the 2 points
delta=3Ds= ub(point1,=20 point2);
// Now find the length
distance=3Dlength(delta);
//Use li= near()=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&quo= t;);
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].valueAtTi= me(0) *=20 n);
[x,y]


=A0

--001a11c38a885ae29f04eb2c8ac1--