Script to compress motion using marker sets
Posted: May 26th, 2008, 7:59 am
Hi everyone, thanks for your continued support of the AE community!
I originally posted this under the expressions discussions, but as I look under the hood a little more it seems this is more of a script-based challenge.
Inspired by Lloyd Alvarez's recent expressions, I'm trying to create an interactive way to compress position based on sets of markers. Here's the process I'm trying to work through, though not much success with my basic knowledge of iterative loops:
1. start with 2 linear-interpolation position keyframes to indicate start and end position of the layer
2. somewhere between these keyframes, add 4 markers - marker.key(1) and marker.key(4) indicate the positional values where the compression of the motion will take place; marker.key(2).time indicates the new time of marker.key(1).value; marker.key(3).time indicates the new time of marker.key(4).value (see image attached)
3. run script to remap positions values, and add easing between marker.key(2) and marker.key(3) to create the overall effect of constant velocity -> speed ramp -> constant velocity
4. if there are multiple compressions within the start and end keyframes, perform an iterative check for sets of 4 markers [1,2,3,4] and [5,6,7,8] and remap values accordingly, keeping motion linear outside these sets of 4 markers.
I know this can be done by precomposing and time-remapping, I'd prefer to keep it on one layer in one comp and have it done with markers.
thanks for your help, Peter
I originally posted this under the expressions discussions, but as I look under the hood a little more it seems this is more of a script-based challenge.
Inspired by Lloyd Alvarez's recent expressions, I'm trying to create an interactive way to compress position based on sets of markers. Here's the process I'm trying to work through, though not much success with my basic knowledge of iterative loops:
1. start with 2 linear-interpolation position keyframes to indicate start and end position of the layer
2. somewhere between these keyframes, add 4 markers - marker.key(1) and marker.key(4) indicate the positional values where the compression of the motion will take place; marker.key(2).time indicates the new time of marker.key(1).value; marker.key(3).time indicates the new time of marker.key(4).value (see image attached)
3. run script to remap positions values, and add easing between marker.key(2) and marker.key(3) to create the overall effect of constant velocity -> speed ramp -> constant velocity
4. if there are multiple compressions within the start and end keyframes, perform an iterative check for sets of 4 markers [1,2,3,4] and [5,6,7,8] and remap values accordingly, keeping motion linear outside these sets of 4 markers.
I know this can be done by precomposing and time-remapping, I'd prefer to keep it on one layer in one comp and have it done with markers.
thanks for your help, Peter