Return-Path: Received: from mail-oa0-f41.google.com ([209.85.219.41] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 4849572 for AE-List@media-motion.tv; Mon, 17 Sep 2012 21:47:47 +0200 Received: by oagj6 with SMTP id j6so5072972oag.28 for ; Mon, 17 Sep 2012 12:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=MczeKKCKEukzGMBIJzEHmePa0R6pkIQSp4cBZjH6qaU=; b=0xk9DGC/PHZdAdCCfVq3pnNvaSKFmQO5TpCgKZ4bFKE0aLX4dj+KbKUzBmFR0HASk8 MmSDJdiDQ4DD4EdynfU64cnp07Awxb+Wxflxpkf4dx0HMUuaXdf1sRvphVT3RwKbaURj fMtRJTnzfKHvaL7i8S6WjnmtG0hleIefKrKMSPUX/2G4j//Z96+av2eYsNL02fLL22UP yP55NO7gdYmkcRBZOMb1P/ztEN5i+vh6OGuwcx0gTq/Fn0x3XkEDr2ZaPBvycSjckfIn eF286yVyZXQh71QAh3JG2ZLAkI7zaQIq596CSpKGbfb/jB1FUwu2iMWc+l8/fs0IaH+B uQJg== Received: by 10.60.172.15 with SMTP id ay15mr12762255oec.64.1347911352430; Mon, 17 Sep 2012 12:49:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.28.229 with HTTP; Mon, 17 Sep 2012 12:48:52 -0700 (PDT) In-Reply-To: References: From: Byron Nash Date: Mon, 17 Sep 2012 15:48:52 -0400 Message-ID: Subject: Re: [AE] Layer Space transform onto parented layers To: After Effects Mail List Content-Type: multipart/alternative; boundary=bcaec54faf2c59af6a04c9eb1173 --bcaec54faf2c59af6a04c9eb1173 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yep, I tried it on other layers in my comp and get the same thing. I'll pursue some other workarounds. Thanks for your help Dan. On Mon, Sep 17, 2012 at 3:03 PM, Dan Ebberts wrote: > I=92m stumped. I=92ve never seen that error and I can=92t seem to gener= ate it. > > Dan > > *From:* Byron Nash > *Sent:* Monday, September 17, 2012 11:39 AM > *To:* After Effects Mail List > *Subject:* Re: [AE] Layer Space transform onto parented layers > > Weird, it seems to take the expression but then I get this error: > > After Effects warning: layer to world matrix isn=92t invertible in fromWo= rld > Expression disabled. > > Error occurred at line 2. > Comp: =91MHI_logo_Layers 2=92 > Layer: 17 (=91red arrow 2=92) > Property: =91Orientation=92 > > > > > On Mon, Sep 17, 2012 at 2:12 PM, Dan Ebberts wrote= : > >> This should give you the position: >> >> L =3D thisComp.layer("parented null"); >> L.toWorld(L.anchorPoint); >> >> And this should give you the orientation: >> >> L =3D thisComp.layer("parented null"); >> u =3D L.toWorldVec([1,0,0]); >> v =3D L.toWorldVec([0,1,0]); >> w =3D normalize(L.toWorldVec([0,0,1])); >> >> sinb =3D clamp(w[0],-1,1); >> b =3D Math.asin(sinb); >> cosb =3D Math.cos(b); >> if (Math.abs(cosb) > .0005){ >> c =3D -Math.atan2(v[0],u[0]); >> a =3D -Math.atan2(w[1],w[2]); >> }else{ >> a =3D (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]); >> c =3D 0; >> } >> [radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)] >> >> >> Dan >> >> >> *From:* Byron Nash >> *Sent:* Monday, September 17, 2012 10:20 AM >> *To:* After Effects Mail List >> *Subject:* Re: [AE] Layer Space transform onto parented layers >> >> How about the other direction? I have a layer that is parented inside a >> heirarchy. I need to match another layer to it that is unparented. Most = of >> the motion is from the parent layers rotation. Also, I have moved the >> anchorpoints around so they are not in the center. I am trying differen= t >> combinations of toWorld and fromWorld and can't seem to get it working. = I >> need another one on the rotation to get it oriented correctly, would tha= t >> go on Orientation or the individual axes? >> >> On Wed, Sep 5, 2012 at 6:06 PM, Darby Edelen wrote: >> >>> This line: >>> >>> parent.fromWorld(p); >>> >>> Should work no matter how deeply parented the null is. The reason being >>> that it will take a world position (p) and transform it into the >>> local/layer space of the current layer's parent. This is exactly how a >>> child's position is defined (i.e. in the parent's local/layer space). >>> >>> The part that is really important is the parent.fromWorld(). You could >>> put any world coordinate in there and it should work. >>> On Sep 5, 2012 11:19 PM, "Byron Nash" wrote: >>> >>>> Thanks for the expression. I haven't had a chance to test it yet. I di= d >>>> not think of stacking the toWorld and fromWorld. What if the parented = null >>>> is several parent layers deep? >>>> >>>> On Wed, Sep 5, 2012 at 12:39 PM, Darby Edelen wrote= : >>>> >>>>> In order to transform the parented null to the unparented null you'll >>>>> need to use an expression in this form; applied to the parented null'= s >>>>> position: >>>>> >>>>> l =3D thisComp.layer("unparented null"); >>>>> p =3D l.toWorld(l.anchorPoint); >>>>> parent.fromWorld(p); >>>>> >>>>> I can't confirm this is correct at the moment, but it should at least >>>>> be close. >>>>> On Sep 5, 2012 5:37 PM, "Byron Nash" wrote: >>>>> >>>>>> I need to "constrain" one null to another with Layer Space >>>>>> transforms. The null that I am matching FROM is not parented at all.= The >>>>>> one I am wanting to add the expression TO is parented several levels= deep. >>>>>> I have tried various combinations of toComp, fromComp, toWorld, from= World, >>>>>> etc... What is the proper way to apply a comp position value to a la= yer >>>>>> that is inheriting many levels of offsets? >>>>>> >>>>>> Thanks! >>>>>> >>>>> >>>> >> > > --bcaec54faf2c59af6a04c9eb1173 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yep, I tried it on other layers in my comp and get the same thing. I'll= pursue some other workarounds. =A0Thanks for your help Dan.

On Mon, Sep 17, 2012 at 3:03 PM, Dan Ebberts <debb= erts@comcast.net> wrote:
I=92m stumped. I=92ve never seen that error and I can=92t seem to gene= rate=20 it.
=A0
Dan
=A0
From: Byron Nash
Sent: Monday, September 17, 2012 11:39 AM
Subject: Re: [AE] Layer Space transform onto parented=20 layers
=A0
Weird,=20 it seems to take the expression but then I get this error:=20
=A0
After Effects warning: layer to world matrix isn=92t invertible in=20 fromWorld
Expression disabled.
=A0
Error occurred at line 2.
Comp: =91MHI_logo_Layers 2=92
Layer: 17 (=91red arrow 2=92)
Property: =91Orientation=92
=A0
=A0
=A0
=A0
On Mon, Sep 17, 2012 at 2:12 PM, Dan Ebberts <debberts@comcast.net> wrote:
This should give you the position:
=A0
L =3D thisComp.layer("parented null");
L.toWorld(L.anchorPoint);
=A0
And this should give you the orientation:
=A0
L =3D thisComp.layer("parented null");
u =3D L.toWorldVec([1,0,0]);
v =3D L.toWorldVec([0,1,0]);
w =3D normalize(L.toWorldVec([0,0,1]));
=A0
sinb =3D clamp(w[0],-1,1);
b =3D Math.asin(sinb);
cosb =3D Math.cos(b);
if (Math.abs(cosb) > .0005){
=A0 c =3D -Math.atan2(v[0],u[0]);
=A0 a =3D -Math.atan2(w[1],w[2]);
}else{
=A0 a =3D (sinb < 0=A0 ?=A0 -1 :=20 1)*Math.atan2(u[1],v[1]);
=A0 c =3D 0;
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]
=A0
=A0
Dan
=A0
=A0
From: Byron Nash
Sent: Monday, September 17, 2012 10:20 AM
Subject: Re: [AE] Layer Space transform onto parented=20 layers
=A0
How=20 about the other direction? I have a layer that is parented inside a heira= rchy.=20 I need to match another layer to it that is unparented. Most of the motio= n is=20 from the parent layers rotation. Also, I have moved the anchorpoints arou= nd so=20 they are not in the center.=A0 I am trying different combinations of=20 toWorld and fromWorld and can't seem to get it working. I need anothe= r one on=20 the rotation to get it oriented correctly, would that go on Orientation o= r the=20 individual axes?

On Wed, Sep 5, 2012 at 6:06 PM, Darby Edelen <= span dir=3D"ltr"><dedelen@gmail.com> wrote:

This line:

parent.fromWorld(p);

Should work no matter how deeply parented the null is. The reason be= ing=20 that it will take a world position (p) and transform it into the local/= layer=20 space of the current layer's parent. This is exactly how a child= 9;s position=20 is defined (i.e. in the parent's local/layer space).

The part that is really important is the parent.fromWorld(). You cou= ld=20 put any world coordinate in there and it should work.

On Sep 5, 2012 11:19 PM, "Byron Nash&qu= ot; <byronnash@= gmail.com>=20 wrote:
Thanks for the expression. I have= n't had a chance to=20 test it yet. I did not think of stacking the toWorld and fromWorld. W= hat=20 if the parented null is several parent layers deep?

On Wed, Sep 5, 2012 at 12:39 PM, Darby Ede= len <dedelen@gmail.com> wrote:

In order to transform the parented null to the unparented null y= ou'll=20 need to use an expression in this form; applied to the parented nul= l's=20 position:

l =3D thisComp.layer("unparented null");
p =3D=20 l.toWorld(l.anchorPoint);
parent.fromWorld(p);

I can't confirm this is correct at the moment, but it should= at least=20 be close.

On Sep 5, 2012 5:37 PM, "Byron Nash= " <byronna= sh@gmail.com> wrote:
I need to "constrain&quo= t; one null to another with Layer=20 Space transforms. The null that I am matching FROM is not parente= d at=20 all. The one I am wanting to add the expression TO is parented se= veral=20 levels deep. I have tried various combinations of toComp, fromCom= p,=20 toWorld, fromWorld, etc... What is the proper way to apply a comp= =20 position value to a layer that is inheriting many levels of offse= ts?=20
=A0
Thanks!

=A0
=A0

--bcaec54faf2c59af6a04c9eb1173--