Hi Hiro! Something like this might work. I’m using ease() in this case but feel free to use easeOut(), easeIn() or linear() if you prefer.
Position:
var sel = effect(“Camera Angle”)(“Dropdown”);
var duration = effect(“Animation Duration”)(“Slider”); // Assuming you have a duration slider
// Define keyframes for each option
var positions = [
[[0, 0, 0], [200, 0, 0]], // Bottom to top
[[0, 0, 0], [0, -200, 0]], // Top to bottom
[[0, 0, 0], [-200, 0, 0]], // Left to right
[[0, 0, 0], [200, 0, 0]] // Right to left
];
// Calculate progress
var t = time – inPoint;
var progress = clamp(t / duration, 0, 1);
// Interpolate using ease
ease(progress, 0, 1, positions[sel-1][0], positions[sel-1][1]);
And for Rotation:
var sel = effect(“Camera Angle”)(“Dropdown”);
var duration = effect(“Animation Duration”)(“Slider”);
var rotations = [
[[0, 0, 0], [0, 15, 0]], // Bottom to top
[[0, 0, 0], [0, -15, 0]], // Top to bottom
[[0, 0, 0], [0, 0, 15]], // Left to right
[[0, 0, 0], [0, 0, -15]] // Right to left
];
var t = time – inPoint;
var progress = clamp(t / duration, 0, 1);
ease(progress, 0, 1, rotations[sel-1][0], rotations[sel-1][1]);
I haven’t tested it but let me know if this is what you were looking for. 🙂