Return-Path: Received: from p02c12o143.mxlogic.net ([208.65.145.76] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5050334 for AE-List@media-motion.tv; Wed, 24 Apr 2013 22:32:31 +0200 Received: from unknown [216.57.150.10] (EHLO exchangecashub.crameronline.com) by p02c12o143.mxlogic.net(mxl_mta-7.0.0-1) over TLS secured channel with ESMTP id 15348715.0.278862.00-346.726334.p02c12o143.mxlogic.net (envelope-from ); Wed, 24 Apr 2013 14:40:52 -0600 (MDT) X-MXL-Hash: 5178435442c90740-c18863aa55b453e1d6faa4cc64e5e53885159ecc Received: from EXCHANGEMBX.cramerdom.com ([172.16.1.55]) by EXCHANGECasHub.cramerdom.com ([172.16.1.25]) with mapi id 14.02.0247.003; Wed, 24 Apr 2013 16:40:49 -0400 From: Michael Powers To: After Effects Mail List Subject: RE: [AE] Converting animated camera Orientation to Rotation? Thread-Topic: [AE] Converting animated camera Orientation to Rotation? Thread-Index: AQHOQSoO+4LJnO+luUmn6rUHI0KsoZjl02qQ Date: Wed, 24 Apr 2013 20:40:48 +0000 Message-ID: <8C6FE228180FE143B942B993AE2E1C746361B4FE@EXCHANGEMBX.cramerdom.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.1.15] Content-Type: multipart/alternative; boundary="_000_8C6FE228180FE143B942B993AE2E1C746361B4FEEXCHANGEMBXcram_" MIME-Version: 1.0 X-AnalysisOut: [v=2.0 cv=f8T/8pOM c=1 sm=1 a=92rrH11NjGMdhXfoADi2UA==:17 a] X-AnalysisOut: [=rtz_HrNLLBsA:10 a=MCILvYHnnE0A:10 a=fvH1djJbZqEA:10 a=BLc] X-AnalysisOut: [eEmwcHowA:10 a=G7-xRGy1AAAA:8 a=ERUe88dTAAAA:8 a=eEMkhbAa0] X-AnalysisOut: [GgA:10 a=8pif782wAAAA:8 a=ZsGHq9l7AAAA:8 a=3j4BkbkPAAAA:8 ] X-AnalysisOut: [a=jU4qhlNgAAAA:8 a=C_IRinGWAAAA:8 a=pGLkceISAAAA:8 a=KmRas] X-AnalysisOut: [ElM57VH6t46YLMA:9 a=CjuIK1q_8ugA:10 a=SrpMv_ytQi4A:10 a=ZF] X-AnalysisOut: [-vLlx_tRYA:10 a=si9q_4b84H0A:10 a=MSl-tDqOz04A:10 a=2kxFbP] X-AnalysisOut: [_j9McqVTD2:21 a=pT8deEHmQ1Z-mqgk:21 a=yMhMjlubAAAA:8 a=SSm] X-AnalysisOut: [OFEACAAAA:8 a=XV5U66rXfZ-9VxYuxDgA:9 a=gKO2Hq4RSVkA:10 a=U] X-AnalysisOut: [iCQ7L4-1S4A:10 a=hTZeC7Yk6K0A:10 a=frz4AuCg-hUA:10 a=tXsnl] X-AnalysisOut: [iwV7b4A:10 a=FpR1gs9r1NkT_91j:21 a=7BlChL3R3FbBygqg:21 a=Z] X-AnalysisOut: [DYbfsfw1xdac45z:21] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)] X-MAIL-FROM: X-SOURCE-IP: [216.57.150.10] --_000_8C6FE228180FE143B942B993AE2E1C746361B4FEEXCHANGEMBXcram_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Or might need to test for direction of rotation and add or subtract (the fu= ll rotation counter) 2pi. Like slerp() from quats. From: After Effects Mail List [mailto:AE-List@media-motion.tv] On Behalf Of= Phil Spitler Sent: Wednesday, April 24, 2013 4:27 PM To: After Effects Mail List Subject: Re: [AE] Converting animated camera Orientation to Rotation? Sounds like Gimbal Lock to me. http://en.wikipedia.org/wiki/Gimbal_lock Phil Phil Spitler | Creative Technologist | Bonfire Labs | t : 415.394.82= 00 m : 415.571.3139 Website | Facebook | LinkedIn On Apr 24, 2013, at 1:16 PM, Robert Kjettrup wrote: Wow... thanks Dan, exactly what i wanted. if it also could automaticly fix the big jumps in the graph when the value = crosses 360degrees, then you should make an deal with adobe to supply this = as a standard script with AE ;-) - Robert 2013/4/24 Dan Ebberts > Try this: { var myComp =3D app.project.activeItem; if ((myComp !=3D null) && (myComp instanceof CompItem) && (myComp.selec= tedLayers.length !=3D 0)){ app.beginUndoGroup("Convert 3D Orientation to Rotation"); var myLayer; var myVal; var t; for (var i =3D 0; i < myComp.selectedLayers.length; i++){ myLayer =3D app.project.activeItem.selectedLayers[i]; myOrientation =3D myLayer.property("Orientation"); if (myOrientation.numKeys > 0){ for (var j =3D 1; j <=3D myLayer.property("Orientation").nu= mKeys; j++){ myVal =3D myLayer.property("Orientation").keyValue(j); t =3D myLayer.property("Orientation").keyTime(j); myLayer.property("xRotation").setValueAtTime(t,myVal[0]= ); myLayer.property("yRotation").setValueAtTime(t,myVal[1]= ); myLayer.property("zRotation").setValueAtTime(t,myVal[2]= ); myLayer.property("orientation").setValueAtKey(j,[0,0,0]= ); } }else{ myVal =3D myLayer.property("Orientation").value; myLayer.property("xRotation").setValue(myVal[0]); myLayer.property("yRotation").setValue(myVal[1]); myLayer.property("zRotation").setValue(myVal[2]); myLayer.property("orientation").setValue([0,0,0]); } } app.endUndoGroup(); }else{ alert("Please select at least one layer..."); } } Dan From: Robert Kjettrup Sent: Wednesday, April 24, 2013 12:16 PM To: After Effects Mail List Subject: Re: [AE] Converting animated camera Orientation to Rotation? No... i just want to manually adjust some of the keyframes of the rotation,= eg. smoothing some areas, but that is really hard to do with the orientati= on keyframes when it jumps from 359.9 degrees to 0, making huuuge visual ju= mps in the graph editor. - Robert 2013/4/24 scott.aelist > > Doing any adjustments on a keyframed orientation is really counterintuiti= ve. Sounds like you want to use an expression rather than a script then? +---End of message---+ To unsubscribe send any message to > --_000_8C6FE228180FE143B942B993AE2E1C746361B4FEEXCHANGEMBXcram_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable signature1

Or might need to test for direction of rotation and add or subtract (t= he full rotation counter) 2pi. Like slerp() from quats.

 <= /p>

 

From: After Ef= fects Mail List [mailto:AE-List@media-motion.tv] On Behalf Of Phil Spitler
Sent: Wednesday, April 24, 2013 4:27 PM
To: After Effects Mail List
Subject: Re: [AE] Converting animated camera Orientation to Rotation= ?

 

Sounds like Gimbal Lock to me.

 

 

Phil

 

 

Phil Spitler&n= bsp; |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn

 

On Apr 24, 2013, at 1:16 PM, Robert Kjettrup wrote:<= o:p>



Wow... thanks Dan, exactly what i wanted. =

 

if it also could automaticly fix the big jumps in th= e graph when the value crosses 360degrees, then you should make an deal wit= h adobe to supply this as a standard script with AE ;-)

 

 

- Robert

 

2013/4/24 Dan Ebberts <debberts@comcast.net>

Try this:

 

{

    var myComp =3D app.project.activeItem;

    if ((myComp !=3D null) && (myCom= p instanceof CompItem) && (myComp.selectedLayers.length !=3D 0)){

        app.beginUndoGro= up("Convert 3D Orientation to Rotation");

        var myLayer;

        var myVal;<= /o:p>

        var t;

        for (var i =3D 0= ; i < myComp.selectedLayers.length; i++){

          = ;  myLayer =3D app.project.activeItem.selectedLayers[i];

          = ;  myOrientation =3D myLayer.property("Orientation");

          = ;  if (myOrientation.numKeys > 0){

          = ;      for (var j =3D 1; j <=3D myLayer.propert= y("Orientation").numKeys; j++){

          = ;          myVal =3D myLayer.p= roperty("Orientation").keyValue(j);

          = ;          t =3D myLayer.prope= rty("Orientation").keyTime(j);

          = ;          myLayer.property(&q= uot;xRotation").setValueAtTime(t,myVal[0]);

          = ;          myLayer.property(&q= uot;yRotation").setValueAtTime(t,myVal[1]);

          = ;          myLayer.property(&q= uot;zRotation").setValueAtTime(t,myVal[2]);

          = ;          myLayer.property(&q= uot;orientation").setValueAtKey(j,[0,0,0]);

          = ;      }

          = ;  }else{

          = ;      myVal =3D myLayer.property("Orientatio= n").value;

          = ;      myLayer.property("xRotation").set= Value(myVal[0]);

          = ;      myLayer.property("yRotation").set= Value(myVal[1]);

          = ;      myLayer.property("zRotation").set= Value(myVal[2]);

          = ;      myLayer.property("orientation").s= etValue([0,0,0]);

          = ;  }

        }

        app.endUndoGroup= ();

    }else{

        alert("Plea= se select at least one layer...");

    }

}

 

 

Dan

 

Sent:= Wednesday, April 24, 2013 12:16 PM

Subje= ct: Re: [AE] Converting animated camera Orientation = to Rotation?

 

No... i just want to manually adjust some of the keyframes = of the rotation, eg. smoothing some areas, but that is really hard to do wi= th the orientation keyframes when it jumps from 359.9 degrees to 0, making huuuge visual jumps in the graph editor.

 

- Robert

 

 

2013/4/24 scott.aelist <scott.aelist@gmail.com>

> Doing any adjustments o= n a keyframed orientation is really counterintuitive.

Sounds like you want to use an expression rather than a scr= ipt then?

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

 

 

 

--_000_8C6FE228180FE143B942B993AE2E1C746361B4FEEXCHANGEMBXcram_--