Mailing List AE-List@media-motion.tv ? Message #48660
From: Robert Kjettrup <robert@stvmayday.dk>
Subject: Re: [AE] Converting animated camera Orientation to Rotation?
Date: Wed, 24 Apr 2013 22:16:32 +0200
To: After Effects Mail List <AE-List@media-motion.tv>
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