Return-Path: Received: from mail-vb0-f48.google.com ([209.85.212.48] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5050253 for AE-List@media-motion.tv; Wed, 24 Apr 2013 22:08:32 +0200 Received: by mail-vb0-f48.google.com with SMTP id p13so2038149vbe.21 for ; Wed, 24 Apr 2013 13:16:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:x-gm-message-state; bh=KkYQxiNdKavbVgAmtqKNWE/JXTnyfNYtfeoYXKHsxs0=; b=lp4pQK+mQWgXjTuvCrn3yWq1PwWOEiudC1ktYo9PCXsYzHAJICk+Q8aXK6pQg/3jkf t1FcB5AIRP7291VVAfrq8lQpgvamnKS67ViVtd8E1rCImyROl9YOxG7K9WH1CmhjRbbB aMKQ4exHnoezk1O/wcRiTDX9n/UWP6V2HVTmwIOlvRvPr16t7K4SJTMV8YW5AH5HjBR/ dDmLV6Mh3HhGbv0w9Rt3PmIsQ1XaZxX2QsFZCPXIrSzgrMl+Bo3mFc/JnEny6Gpj+GOh mjXeN/pD8hgBce5PwgjxsLHCtZyJ01n8yxZDrfol3gDCdW837ncFErUE/8zvoR0Bf/uS QK1g== X-Received: by 10.220.76.129 with SMTP id c1mr25675057vck.48.1366834612508; Wed, 24 Apr 2013 13:16:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.219.197 with HTTP; Wed, 24 Apr 2013 13:16:32 -0700 (PDT) In-Reply-To: References: From: Robert Kjettrup Date: Wed, 24 Apr 2013 22:16:32 +0200 Message-ID: Subject: Re: [AE] Converting animated camera Orientation to Rotation? To: After Effects Mail List Content-Type: multipart/alternative; boundary=001a11c2af008bd9d404db20fbdf X-Gm-Message-State: ALoCoQn8c1xqJ3+Y/XH/p2UkRerM21xTAGSKD5FyUHHIURnFmDcLa2j59d373EhxU4jzl6wtAbJN --001a11c2af008bd9d404db20fbdf Content-Type: text/plain; charset=ISO-8859-1 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 = app.project.activeItem; > if ((myComp != null) && (myComp instanceof CompItem) && > (myComp.selectedLayers.length != 0)){ > app.beginUndoGroup("Convert 3D Orientation to Rotation"); > var myLayer; > var myVal; > var t; > for (var i = 0; i < myComp.selectedLayers.length; i++){ > myLayer = app.project.activeItem.selectedLayers[i]; > myOrientation = myLayer.property("Orientation"); > if (myOrientation.numKeys > 0){ > for (var j = 1; j <= > myLayer.property("Orientation").numKeys; j++){ > myVal = myLayer.property("Orientation").keyValue(j); > t = 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 = 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 > 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 > >> > Doing any adjustments on a keyframed orientation is really >> counterintuitive. >> >> Sounds like you want to use an expression rather than a script then? >> >> +---End of message---+ >> To unsubscribe send any message to >> > > --001a11c2af008bd9d404db20fbdf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Wow... thanks Dan, exactly what i wanted.=A0

if it also could au= tomaticly 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 scrip= t with AE ;-)


- Robert


2013/4/24 Dan Ebberts = <debberts@comc= ast.net>
Try this:
=A0
{
=A0=A0=A0 var myComp =3D app.project.activeItem;
=A0=A0=A0 if ((myComp !=3D null) && (myComp instanceof=20 CompItem) && (myComp.selectedLayers.length !=3D 0)){
=A0=A0=A0=A0=A0=A0=A0 app.beginUndoGroup("Convert 3D=20 Orientation to Rotation");
=A0=A0=A0=A0=A0=A0=A0 var myLayer;
=A0=A0=A0=A0=A0=A0=A0 var myVal;
=A0=A0=A0=A0=A0=A0=A0 var t;
=A0=A0=A0=A0=A0=A0=A0 for (var i =3D 0; i <=20 myComp.selectedLayers.length; i++){
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 myLayer=20 =3D app.project.activeItem.selectedLayers[i];
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myOrientation =3D myLayer.property("Orientation");
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if=20 (myOrientation.numKeys > 0){
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 for (var j =3D 1; j <=3D myLayer.property("Orientation").numKe= ys; j++){
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myVal =3D myLayer.property("Orientation").keyValue(j);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 t =3D myLayer.property("Orientation").keyTime(j);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("xRotation").setValueAtTime(t,myVal[0]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("yRotation").setValueAtTime(t,myVal[1]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("zRotation").setValueAtTime(t,myVal[2]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("orientation").setValueAtKey(j,[0,0,0]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 }
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 }else{
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myVal =3D myLayer.property("Orientation").value;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("xRotation").setValue(myVal[0]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("yRotation").setValue(myVal[1]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("zRotation").setValue(myVal[2]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=20 myLayer.property("orientation").setValue([0,0,0]);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0 app.endUndoGroup();
=A0=A0=A0 }else{
=A0=A0=A0=A0=A0=A0=A0 alert("Please select at least=20 one layer...");
=A0=A0=A0 }
}
=A0
=A0
Dan
=A0
Sent: Wednesday, April 24, 2013 12:16 PM
Subject: Re: [AE] Converting animated camera Orientation to=20 Rotation?
=A0
No... i just want to manually adjust some of the keyframes= of the=20 rotation, eg. smoothing some areas, but that is really hard to do with the= =20 orientation keyframes when it jumps from 359.9 degrees to 0, making huuuge= =20 visual jumps in the graph editor.
=A0
- Robert
=A0
=A0
2013/4/24 scott.aelist <scott.aelist@gmail= .com>
> Doing any adjustments on a keyframed orientation is really=20 counterintuitive.

Sounds like you want to use an expression= =20 rather than a script then?

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

--001a11c2af008bd9d404db20fbdf--