ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

2 buttons > Add Keyframe > Time Remap

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bob Ueckerlele
2 buttons > Add Keyframe > Time Remap
on Oct 17, 2012 at 6:42:23 pm

Ok, so this is tagging on with the Rabinowitz tutorial on keying phonemes. I, like many of us out there, tend to use my keyboard and not my mouse for speed so obviously we need a faster way to do this rather than manually selecting each frame, re-timing it, etc....

To that end, I'm employing the KeyedUp script to call the Time Remapper script by Dan Fredly.

Only problem is that it will place a keyframe at the given location in time OF the given time. So, if I want it to play frame 1 when it's @ frame 20, I'm out of luck.

I've tried to sub-in dialog boxes and prompts and whatnot but I just don't have the grasp of javascript to get it done.


Modify this code so that it allows one to specify a specific frame that you'd like to set at the current place in time. Get it?

/ TimeRemapper.jsx by Dan Fredley ©2012
// Version 1.0
// This script can be set as a keyboard shortcut to first enable time-remapping then to set a keyframe at the current time for time-remapping
// Follow the instructions at
// You can override the original Time Remapping shortcut (Command/Ctrl + Option/Alt + T) using the "Keyed Up.jsx" script
// Note: If you override the original shortcut you will only be able to toggle time-remap OFF by clicking on the stop-watch
// This script will first enable time-remapping if it is not already enabled, then you'll need to call it again to set a keyframe
// If time-remapping is already enabled then it will set a keyframe at the current time
// No scripts are guaranteed and use at your own risk, etc.
function TimeRemapper()
app.beginUndoGroup("TimeRemapper"); // create script undo group
var proj = app.project;
var comp = proj.activeItem;
var activeLayer, curTime, newKey;

if (!(comp instanceof CompItem)) { // check if a comp is selected
alert("Please select a composition.");
} else if (comp.selectedLayers.length != 1){ // check if a single layer is selected
alert("Please select a single layer.");
} else if (!(comp.selectedLayers[0].canSetTimeRemapEnabled)){ // check if the layer is able to be time-remapped (must NOT be a still image, text, solid, shape layer, etc.)
alert("The selected layer cannot be time-remapped)");
activeLayer = comp.selectedLayers[0];
curTime = comp.time; // set current time to the compositions current time indicator
if (activeLayer.timeRemapEnabled == false){ // if time remapping is not enabled
activeLayer.timeRemapEnabled = true; // enable time-remapping
activeLayer.timeRemap.selected = true; // and select all time-remap keyframes
} else {
newKey = activeLayer.timeRemap.addKey(curTime);
for (i = 1; i < activeLayer.timeRemap.numKeys; i++) { // loop through all keyframes on the time-remap property
activeLayer.timeRemap.setSelectedAtKey(i, false); // deselect all keys on time-remap property, so we can then only select the newly added keyframe
activeLayer.timeRemap.setSelectedAtKey(newKey, true); // go ahead and select the new keyframe

app.endUndoGroup(); // end the undo group

Return to posts index

Roland R. Kahlenberg
Re: 2 buttons > Add Keyframe > Time Remap
on Oct 18, 2012 at 1:34:15 am

There's a much better tool for animating/synching mouth movement - Auto Lip-Sync.


Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects ACE/ACI (version 7)

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved