Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

multiple valueAtTime() on one layer?

New Here ,
Oct 30, 2022 Oct 30, 2022

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

TOPICS
Expressions
308
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2022 Oct 30, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2022 Oct 31, 2022
LATEST

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines