Hi Guys !
I have managed to change the animation to a circle, instead of a straight line, just like pants asked !
I have tweaked the project file Paul uploaded, and added another Control Layers at the top, that does the job.
I added also a camera to show the scene a bit from above, and changed the location of the light source.
I made 2 options: one is a half circle, as in the link pants had sent, and the second one is a full circle !
You can download the project file here:
- coverflow.zip
- Circular_Cover_Flow
- (13.75 KiB) Downloaded 5456 times
You can use that file, the same you used Pauls' file: the most upper Control Layer would control the motion.
(change the Control layer's Slider keyframes in order to flow the pictures, I've keyframed them to see the animation)
I managed to do it using a small script I wrote that changes the position and rotation keyframes of the Control layer, and replaces the keyframes needed for the circular motion.
If you find it interesting, here is the script:
Code: Select all
// Circular Cover Flow Animation - changing Contol Layer's keyframes
// Written by Koby Goldberg
// select one Control Layer, remove all it's keyframes and run the script.
// put: K = 1 for half circle, and K = 2 for a full circle
{
app.beginUndoGroup("CircularCoverFlowAnimation"); // create an undo group
var curItem = app.project.activeItem;
if (curItem == null || !(curItem instanceof CompItem)){ // check if comp is selected
alert("Please establish a comp as the active item and run the script again"); // if no comp selected, display an alert
} else {
var K = 1; // K=1 - half circle , K=2 - full circle
var curLayer = curItem.selectedLayers[0];
var N = 9; // number of layers in a half circle
var T = curItem.frameDuration;
var T1 = 30*T; // duration time of static phase
var T2 = 20*T; // duration time of movement
var xo = 360; // center of circle - x
var yo = 288; // center of circle - y
var zo = 500; // center of circle - z
var dz = 100; // indent of middle picture
var R = 800; // radius of circle
var pi = Math.PI;
var x,y,z;
var m = 0;
N = N*K + (K-1);
for (var n=0; n<N; n++)
{
if (n==((N-1)/2-1) || n==((N-1)/2+1))
continue;
x = xo + R*Math.cos(pi/K + K*pi*n/(N-1));
z = zo + R*Math.sin(pi/K + K*pi*n/(N-1)) - (n==(N-1)/2 ? dz : 0);
y = yo;
Phiy = (n<(N-1)/2) ? (-n*K*180/(N-1)) : ( (n>(N-1)/2) ? (K*180*((N-n-1)/(N-1))-180*(K-1)) : -90*(K-1) ) ;
curLayer.position.setValueAtTime(m*(T1+T2),[x,y,z]);
curLayer.position.setValueAtTime(m*(T1+T2)+T1,[x,y,z]);
curLayer.yRotation.setValueAtTime(m*(T1+T2),Phiy+ 90*(K-1));
curLayer.yRotation.setValueAtTime(m*(T1+T2)+T1,Phiy+ 90*(K-1));
m++;
}
}
app.endUndoGroup(); // close the undo group
}
You can use the script on the original file Paul uploaded, to achieve the same result of the project file I've uploaded:
1. choose one Control Layer (or duplicate one, and make sure to rename it to the same original name)
2. remove all it's position and rotation keyframes (by clicking the stop-watch of each property)
3. make sure that layer is selected and run the script (the script will automatically work only on the selected layer)
4. in order to see it propely, add a camera and position it above the scene to show the circular path of the pictures.
(I reccommend using a 138mm Preset Camera or above, in order to avoid perspective distortion of the pictures)
5. move the light source to the center of the screen, and pull it back in Z depth, to light the pictures correctly.
6. In order to have the reflections correclty, operate the script again on the Control Layers in the Refelction composition.
In order to do a half circle, change in the script the value of the K variable to 1, and for a full circle change it's value to 2.
(you'll see it as the first variable in the script: "var K = 1;" . Do this before you run the script off course)
NOTE: You could still use the script atom & byron wrote, in order to import pictures to the project file I've uploaded. Thank you guys for the great job ! Note that if you use atom & byron 's script on my project file, don't delete the camera and the light, and you can leave all Control layers (make them inactive) so you can change the behavior of the animation easily later (by changing their order). Note that when I tried that, I just had to disable the expression the light got by mistake from the script (by clicking the [=] signs), and then it worked perfectly (except the script doesn't add the reflections).
Great thanks to Paul, for making this animation and the expressions in the first place !
Enjoy,
and let me know what you think.
Koby.