From: "D" Received: from mail-qt1-f171.google.com ([209.85.160.171] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 7494920 for AE-List@media-motion.tv; Mon, 20 Jan 2020 17:14:26 +0100 Received: by mail-qt1-f171.google.com with SMTP id v25so174695qto.7 for ; Mon, 20 Jan 2020 08:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ES7Cq/l58NsswMHUz22fSoNFmH30mTMwZ5ai0Ihm4r4=; b=UrZcALljnewzO5bNUc43OWCuanQKPZEPD42y5RmwP2SllXdJQBW2SoXomRHaSODZv6 ja4/juQXgMlxykaljfN+KnC2sGOi1rW5kHlxFmsPO+H/dS5Bo9B4TsY/6zxXA1TPA2UO VnhAqWA//KPiUC4LuMKkpgTJQ1f2M995Otd8TndUDr8OUwozk3rVi5hskutf5PirKAic iJVqpWUfRJM+TTVRE/6f6B5Cchxst/SQG6ACenSCq8ZAG30CIcMWhrxa2aQBjhhXu9ro e3R8D9LZ4czDeFuPxT1bmj6m9rsT/hZWUxsJUpdQC/6dJR/m4KD4Jj1Ulx86QaUhAc2E WHCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ES7Cq/l58NsswMHUz22fSoNFmH30mTMwZ5ai0Ihm4r4=; b=O7AMToPEMfsr1txbySbPeuozEMiZsIsUT3ZYPpXS3AKbYtfNrnlnh65u5kOk6o967e GGa3+5G1p/6Rtg9/sDamrPMqs5NgvpMgv9Hk2tta3NkPs2JZL38EQIySaGgwJJ9r2cMC DuTpgczipdvtVk831LZMFm2C+SDmkQEl48rgunOhxCdnlNLU92DNzN2L5Qoq8xxmVevJ /vd/J/BE59VYflFn9hixjIpVvuzrTvz6NbNMJxKkpRUS7ci0rqgciOfm/CRtjTW4X+Bw Lz55o33hvLIJycXk4zCR30v4r5WI5Kg5IRFqT3NUZEgT46RB+lAeC4ynsTksSWPxxLvY mqwA== X-Gm-Message-State: APjAAAWLIRBVRRLn8pitySfp/hug9kpzatANWLLdXvuhtQD8VdqnGj3G xIrgeWZjQ06iad48eqXU0Euj1o+nJMpPAyJNCx3r7TDL X-Google-Smtp-Source: APXvYqxDN3wFC5PMZ0IArIkohM7bBcrZJiq3Cpsne7MusDOyue7jzaNL05CmR2D3OHgDYicyfMEJ0PMTRpNkDZUqqIo= X-Received: by 2002:aed:2e03:: with SMTP id j3mr21430075qtd.365.1579536864893; Mon, 20 Jan 2020 08:14:24 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:fee:0:0:0:0:0 with HTTP; Mon, 20 Jan 2020 08:14:24 -0800 (PST) In-Reply-To: References: Date: Mon, 20 Jan 2020 16:14:24 +0000 Message-ID: Subject: Re: [AE] Repelling layers To: After Effects Mail List Content-Type: multipart/alternative; boundary="000000000000bdded7059c949571" --000000000000bdded7059c949571 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Excellent Nathan. Is it possible with expressions to make the grey blocks repel each other too? (i=E2=80=99m not asking you to do it, I=E2=80=99m just interested whet= her it=E2=80=99s possible with expressions). Thanks. On Thursday, 16 January 2020, Cary Spenser wrote: > 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 when they're closer than the "Distance Threshold" control. You can increase the 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("Distance 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)) * moveAwayMult; > 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. >> >> --000000000000bdded7059c949571 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Excellent Nathan.

Is it possible with expressions to make the grey b= locks repel each other too? (i=E2=80=99m not asking you to do it, I=E2=80= =99m just interested whether it=E2=80=99s possible with expressions).
Thanks.

On Thursday, 16 January 2020, Cary Spenser <AE-List@media-motion.tv> wrote:
&= gt; Nathan -
> Really helpful to rocket my understanding of scripting= .=C2=A0
> Thanks!
> Cary
> On Wed, Jan 15, 2020 at 1:15 P= M Nathan Shipley <AE-List@med= ia-motion.tv> wrote:
>
> Henry,
> Here's somet= hing really basic I just whipped up that simply moves layers away from a nu= ll.=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 c= an increase the 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 fu= rther.=C2=A0 Expression pasted below as well:
> Here's a quick sc= reencapture showing what it does:
> https://www.dropbox.com/s/9= 7yymslvdmjgeez/MoveAwayDemo_01.mp4?dl=3D0
>
> And here'= s the .AEP:
> https://www.dropbox.com/s/8g3scef520fir3= r/MoveAwayExpression_NS_01.aep?dl=3D0
>
> Not fancy but may= be helpful?
> =C2=A0- Nathan
> p =3D transform.position;
>= ; nullPos =3D thisComp.layer("Parent And Controls").transform.pos= ition;
> distanceThreshold =3D thisComp.layer("Parent And Contro= ls").effect("Distance Threshold")("Slider");
&g= t; moveAwayMult =3D thisComp.layer("Parent And Controls").effect(= "Move Away Muliplier")("Slider");
>
> dista= nce =3D length(p, nullPos);
>
> if (distance < distanceThres= hold) {
> =C2=A0 =C2=A0 distanceMult =3D (Math.log(distanceThreshold = / distance)) * moveAwayMult;
> =C2=A0 =C2=A0 delta =3D nullPos - p;> =C2=A0 =C2=A0 nDelta =3D (normalize(delta));
> =C2=A0 =C2=A0 n= ewPos =3D p - nDelta * distanceMult;
> } else {
> =C2=A0 =C2=A0= p
> }
>
> On Wed, Jan 15, 2020 at 9:13 AM henry birdseye= <AE-List@media-motion.tv= > wrote:
>
> This is true. If I had any sort of budget at al= l this would be ideal.
>
> About a decade ago, ways of doing th= is abounded on the interwebz...
> those links have since passed on. C= haracter Animator has a physics
> engine I may explore.
>
&g= t;
> On 1/15/2020 11:00 AM, Peter Lund wrote:
>> Hi,
>= >
>> i gutes you need something like this.
>>
>&= gt; --000000000000bdded7059c949571--