From: "Cary Spenser" Received: from mail-io1-f43.google.com ([209.85.166.43] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 7493014 for AE-List@media-motion.tv; Thu, 16 Jan 2020 17:44:34 +0100 Received: by mail-io1-f43.google.com with SMTP id m25so6974173ioo.8 for ; Thu, 16 Jan 2020 08:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=R+3guBhMqsXBl4xtrDu4JQFIQBg2sQqWX4hnKQfY21Y=; b=VqF7CKlwVzwWZgeTe9IogktBaNCIZ6npoqMWZ4pGXoSMR5a6YQpHmOFwkmW+hpX16E JnL1f+55Ba7adbIF1POW/HB5BBs8zt/6tVuFfft7sTtmVIO+ArXkwya8tPsXomz1v4Cc HZOCaahnxfAUg6+zTvXMWMTsyOYV7FpRopgybAh5Xel11KgugQPtmhl66k2CI+nweCEV ifwcl7VPKkLJ+UGY397gpPOERY8pk8s4imf7+4wD+x9vi6WtGMvQPnYQZQPvxRiNZr1E z66cPTvo+yPpdK2URaZtDf43AlUY+O3Pa6G6gphnCZ/hps7c7siS8ofYmk73XdH4dynM 8RPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=R+3guBhMqsXBl4xtrDu4JQFIQBg2sQqWX4hnKQfY21Y=; b=sKh8EkMTnlDXnY+C4P074bEyE1HKcf6YltDaKCgukrh4JyXupd5mcRIqWVQJOMvYJW 6wXmnFZ8q9GgMxUKU81Ti7UP9iPJ1PN7KsHCwIEIvIywKDfB07zKScl0Aw/IUOc2BO6q 5qMLh8si0BKDIzy5diMsz6rWE/TCcHzF/sJZnO6zs5PCo+L0z+oRMsRLaQNq46gP7sdp 89oyydsUY/1XPmYazf2tLZwJi8LPqpj63YJTvmlLPDhucf0GII9OSLW6WA8CHWGLQSJS 7pNCIYUURg0+hXLqYleniTxf1DM3QRbTGAs2r0Y4gf7b/DTAqHNJwoIFPlpnjTcQoHkm L9OQ== X-Gm-Message-State: APjAAAXvnh9bFzOKraNg9wxhpThizIy6dUzIg+3w8bhXCvvSrMsx0RSg lUEwKKxliBAd8Z85z0L51OdGLmkwIf84gNHoXxmYWg== X-Google-Smtp-Source: APXvYqxScc6px9aE8GsXfBtEoENDIAHwi1BH/PtvcwQtrrV4VwG9kuo5YC7Zx3l/re9ibq4XhqcfIObD8JJ5ldfMBcU= X-Received: by 2002:a5e:de42:: with SMTP id e2mr28165213ioq.228.1579193073070; Thu, 16 Jan 2020 08:44:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 16 Jan 2020 11:44:22 -0500 Message-ID: Subject: Re: [AE] Repelling layers To: After Effects Mail List Content-Type: multipart/alternative; boundary="00000000000026fc6d059c448a0c" --00000000000026fc6d059c448a0c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Nathan - Really helpful to rocket my understanding of scripting. Thanks! Cary On Wed, Jan 15, 2020 at 1:15 PM Nathan Shipley wrote: > Henry, > > Here's something really basic I just whipped up that simply moves layers > away from a null. It just pushes objects away from where the null is whe= n > they're closer than the "Distance Threshold" control. You can increase t= he > amount that they move with "Move Away Multiplier." > > Just paste the position expression from one of the solids to your own > layers and it should work or at least be a starting point to tinker > further. Expression pasted below as well: > > Here's a quick screencapture showing what it does: > https://www.dropbox.com/s/97yymslvdmjgeez/MoveAwayDemo_01.mp4?dl=3D0 > > And here's the .AEP: > https://www.dropbox.com/s/8g3scef520fir3r/MoveAwayExpression_NS_01.aep?dl= =3D0 > > Not fancy but maybe helpful? > - Nathan > > p =3D transform.position; > nullPos =3D thisComp.layer("Parent And Controls").transform.position; > distanceThreshold =3D thisComp.layer("Parent And Controls").effect("Dista= nce > Threshold")("Slider"); > moveAwayMult =3D thisComp.layer("Parent And Controls").effect("Move Away > Muliplier")("Slider"); > > distance =3D length(p, nullPos); > > if (distance < distanceThreshold) { > distanceMult =3D (Math.log(distanceThreshold / distance)) * moveAwayM= ult; > delta =3D nullPos - p; > nDelta =3D (normalize(delta)); > newPos =3D p - nDelta * distanceMult; > } else { > p > } > > On Wed, Jan 15, 2020 at 9:13 AM henry birdseye > wrote: > >> This is true. If I had any sort of budget at all this would be ideal. >> >> About a decade ago, ways of doing this abounded on the interwebz... >> those links have since passed on. Character Animator has a physics >> engine I may explore. >> >> >> On 1/15/2020 11:00 AM, Peter Lund wrote: >> > Hi, >> > >> > i gutes you need something like this. >> > >> > https://aescripts.com/newton/ >> > >> > a physic engine that helps you with the repelling and interaction. >> > >> > this is all I found under =E2=80=9Ephysic=E2=80=9C topic =E2=80=A6 >> > >> > https://aescripts.com/search/?q=3Dphysic >> > >> > hope this helps you >> > >> > Peter >> > >> >> Am 15.01.2020 um 14:40 schrieb henry birdseye > >: >> >> >> >> I'm trying to get some layers to be repelled by a passing object, the >> links I've found for how to do this are years old and don't work properl= y. >> >> >> >> Paul Tuersley's project no longer exists at >> http://www.aenhancers.com/viewtopic.php?t=3D630 and that seems ideal for >> what I need to do. >> >> >> >> Can anyone help me find a setup I can kind of plug right into. This, >> of course, came as a last minute client request. >> >> >> >> HB >> >> >> >> >> >> +---End of message---+ >> >> To unsubscribe send any message to >> > >> > +---End of message---+ >> > To unsubscribe send any message to >> >> +---End of message---+ >> To unsubscribe send any message to >> > --00000000000026fc6d059c448a0c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nathan -

Really helpful to rocket my un= derstanding of scripting.=C2=A0

Thanks!
=
Cary

On Wed, Jan 15, 2020 at 1:15 PM Nathan Shipley <= ;AE-List@media-motion.tv>= wrote:
Henry,

Here's something really basic I just= whipped up that simply moves layers away from a null.=C2=A0 It just pushes= objects=C2=A0away from where the null is when they're closer than the = "Distance Threshold" control.=C2=A0 You can increase the amount t= hat they move with "Move Away Multiplier."

Just paste the position expression from one of the solids to your own la= yers and it should work or at least be a starting point to tinker further.= =C2=A0 Expression pasted below as well:

Here's= a quick screencapture showing what it does:


Not fancy but= maybe helpful?
=C2=A0- Nathan

p =3D transform.position;
nullPos =3D thisComp.layer(&qu= ot;Parent And Controls").transform.position;
distanceThreshold =3D = thisComp.layer("Parent And Controls").effect("Distance Thres= hold")("Slider");
moveAwayMult =3D thisComp.layer("P= arent And Controls").effect("Move Away Muliplier")("Sli= der");

distance =3D length(p, nullPos);

if (distance <= ; distanceThreshold) {
=C2=A0 =C2=A0 distanceMult =3D (Math.log(distance= Threshold / distance)) * moveAwayMult;
=C2=A0 =C2=A0 delta =3D nullPos -= p;
=C2=A0 =C2=A0 nDelta =3D (normalize(delta));
=C2=A0 =C2=A0 newPos= =3D p - nDelta * distanceMult;
} else {
=C2=A0 =C2=A0 p
}
<= br>

On Wed, Jan 15, 2020 at 9:13 AM henry birdseye <AE-List@media-motion.tv&g= t; wrote:
This i= s true. If I had any sort of budget at all this would be ideal.

About a decade ago, ways of doing this abounded on the interwebz...
those links have since passed on. Character Animator has a physics
engine I may explore.


On 1/15/2020 11:00 AM, Peter Lund wrote:
> Hi,
>
> i gutes you need something like this.
>
> https://aescripts.com/newton/
>
> a physic engine that helps you with the repelling and interaction.
>
> this is all I found under =E2=80=9Ephysic=E2=80=9C topic =E2=80=A6
>
> https://aescripts.com/search/?q=3Dphysic
>
> hope this helps you
>
> Peter
>
>> Am 15.01.2020 um 14:40 schrieb henry birdseye <AE-List@media-motion.tv>= ;:
>>
>> I'm trying to get some layers to be repelled by a passing obje= ct, the links I've found for how to do this are years old and don't= work properly.
>>
>> Paul Tuersley's project no longer exists at http://www.aenhancers.com/viewtopic.php?t=3D630 and that seems idea= l for what I need to do.
>>
>> Can anyone help me find a setup I can kind of plug right into. Thi= s, of course, came as a last minute client request.
>>
>> HB
>>
>>
>> +---End of message---+
>> To unsubscribe send any message to <ae-list-off@media-motion.tv> >
> +---End of message---+
> To unsubscribe send any message to <ae-list-off@media-motion.tv>

+---End of message---+
To unsubscribe send any message to <ae-list-off@media-motion.tv>
--00000000000026fc6d059c448a0c--