Skip to main content
Known Participant
October 31, 2022
Question

multiple valueAtTime() on one layer?

  • October 31, 2022
  • 2 replies
  • 280 views

Firstly, I'm having a hard time explaining tihs, which is probably why I can't seem to figure this out. Hoping someone can guide me towards a better method.

I've got three null layers with some eased moves on them. Each one is intended to be a camera move from the first keyframe to the second. The positions for the keyframes on each of the three nulls are pulled from other parts of the comp, and will change as other things change. This is why I'm not just directly keyframing the camera moves on it's own layer.

 

I'm hoping to create a keyframe-less camera null where I can assign markers. Marker 1 does the move from null 1. Marker 2 from null 2 and Marker 3 from null 3. 
I understand that if I had only one move, I could valueAtTime() it to the null, and be done. But I can't figure out how to do this with multiple markers.

 

My best idea is to create three cameras, and each one "takes over" where the last one left off with it's own valueAtTime(), but I feel like this should be possible on one layer.


Thanks

This topic has been closed for replies.

2 replies

Dan Ebberts
Community Expert
Community Expert
October 31, 2022

It's hard to picture exactly what you're describing, but maybe something like this:

m = marker;
if (m.numKeys > 0){
  n = m.nearestKey(time).index;
  if (time < m.key(n).time) n--;
  if (n > 0){
    t = time - m.key(n).time;
    thisComp.layer("Null " + n).position.valueAtTime(t);
  }else{
    value;
  }
}else
  value
Mylenium
Legend
October 31, 2022

https://aescripts.com/ae-camera-morph/

 

Other than that there's any number of ways to rig up custom setups. Combining multiple valueAtTime() functions would simply be done by filtering them through a linear() function that dynamically substitutes its internal values based on actual time. That and of course you can use all sorts of generic animation scripts to create your animations, too. Anyway, if you want specific advise, you have to show us what you have and explain more specifically how your values are "pulled from other parts of the comp". No point in keeping it vague and generic.

 

Mylenium