Return-Path: Received: from mail-qc0-f182.google.com ([209.85.216.182] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5050294 for AE-List@media-motion.tv; Wed, 24 Apr 2013 22:18:34 +0200 Received: by mail-qc0-f182.google.com with SMTP id k19so1163326qcs.41 for ; Wed, 24 Apr 2013 13:26:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:mime-version:content-type:subject:date:in-reply-to :to:references:message-id:x-mailer:x-gm-message-state; bh=jmZ9Mq+cd9BZbb3zn58lgi6yEniu2dvrx8MOI+fTde0=; b=M6wg6Cc3eaUJEO15//fdwwD/4i1Pw7iJhVTE6j0fYVeR8xhFlHj3sJUpxw4+MqyitB +Qx/15eDvnmSMNy1XgAv4TtEYZCzumI0CHJK5dulaM6j3jHa6T0iFNLVKWsnVl+pMD+B htebeYFGBn2fHOlVsZtr9BrqVy1h32alS+2eWzi/GSS4GLE7XyJ/3XIFZHLyDtyVkWbr CbrQQARVH6WJEMtxD7GmX89s8U8DmY6w8QoJs2oH7Yl0gxnHqCLkXuLbG45rL1REcSjP 0rtGoU7gG50M71H9ZvydTeNPV2qR0ZJvapP6ixnF6+Hik8jOhVTICggwKIeNLNiH4i2X /BIQ== X-Received: by 10.49.5.39 with SMTP id p7mr3792447qep.48.1366835215186; Wed, 24 Apr 2013 13:26:55 -0700 (PDT) Return-Path: Received: from [10.0.0.172] ([65.223.58.66]) by mx.google.com with ESMTPSA id z2sm6731497qad.4.2013.04.24.13.26.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 13:26:54 -0700 (PDT) From: Phil Spitler Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/alternative; boundary="Apple-Mail=_632A2C5A-C945-4559-BC2B-9617D958EC45" Subject: Re: [AE] Converting animated camera Orientation to Rotation? Date: Wed, 24 Apr 2013 13:26:52 -0700 In-Reply-To: To: "After Effects Mail List" References: Message-Id: <543AF072-B3A9-4953-B100-464E0D90661B@bonfirelabs.com> X-Mailer: Apple Mail (2.1283) X-Gm-Message-State: ALoCoQlHQsxa7YCjDXFlC7LURKWWwFaPuDX1JkUqJ7B64IrUOwpzXv0B73PWpqpk3kanCpg0xxpf --Apple-Mail=_632A2C5A-C945-4559-BC2B-9617D958EC45 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Sounds like Gimbal Lock to me. http://en.wikipedia.org/wiki/Gimbal_lock Phil Phil Spitler | 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: > Wow... thanks Dan, exactly what i wanted.=20 >=20 > 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 ;-) >=20 >=20 > - Robert >=20 >=20 > 2013/4/24 Dan Ebberts > Try this: > =20 > { > var myComp =3D app.project.activeItem; > if ((myComp !=3D null) && (myComp instanceof CompItem) && = (myComp.selectedLayers.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").numKeys; 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..."); > } > } > =20 > =20 > Dan > =20 > 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? > =20 > 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. > =20 > - Robert > =20 > =20 > 2013/4/24 scott.aelist > > Doing any adjustments on a keyframed orientation is really = counterintuitive. >=20 > Sounds like you want to use an expression rather than a script then? >=20 > +---End of message---+ > To unsubscribe send any message to > =20 >=20 --Apple-Mail=_632A2C5A-C945-4559-BC2B-9617D958EC45 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=iso-8859-1 Sounds like Gimbal Lock to me.


Phil


signature1 Phil Spitler  |  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:

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 <debberts@comcast.net>
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
 
Sent: Wednesday, April 24, 2013 12:16 PM
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 <scott.aelist@gmail.com>
> 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 <ae-list-off@media-motion.tv>
 


--Apple-Mail=_632A2C5A-C945-4559-BC2B-9617D958EC45--