Skip to content

Instantly share code, notes, and snippets.

@seblavoie
Last active September 1, 2016 01:14
Show Gist options
  • Save seblavoie/df3d5fd06968159733ec15dad9390f9a to your computer and use it in GitHub Desktop.
Save seblavoie/df3d5fd06968159733ec15dad9390f9a to your computer and use it in GitHub Desktop.
// Use if there is *no* time remapping in parent comp.
parentComp = comp("# Main");
compStartTimeInParent = parentComp.layer(thisComp.name).startTime;
audioStartTimeInParent = parentComp.layer(thisLayer.name).startTime;
fullStartTime = this.startTime;
fullEndTime = this.source.duration+startTime;
linear(time, fullStartTime, fullEndTime, fullStartTime+compStartTimeInParent-audioStartTimeInParent, fullEndTime+compStartTimeInParent-audioStartTimeInParent)
// Use if there *is* time remapping in parent comp.
parentComp = comp("# Main");
compStartTimeInParent = parentComp.layer(thisComp.name).startTime;
parentComp.layer(thisLayer.name).timeRemap.valueAtTime(time + compStartTimeInParent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment