Mailing List AE-List@media-motion.tv ? Message #48662
From: Michael Powers <MPowers@cramer.com>
Subject: RE: [AE] Converting animated camera Orientation to Rotation?
Date: Wed, 24 Apr 2013 20:40:48 +0000
To: After Effects Mail List <AE-List@media-motion.tv>
signature1

Or might need to test for direction of rotation and add or subtract (the full 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.

 

 

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. 

 

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>

 

 

 

 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster