Skip to main content
Participant
June 23, 2023
Question

Change keyframes value using expression

  • June 23, 2023
  • 1 reply
  • 663 views

Hi, please need an expression for the following:

 

I have a slider controller with keyframes. I want each keyframe value to be linked to a text layer. so When i change a specific text layer it automatically changes the value of a specific keyframe (the one that is linked to the text layer)

This topic has been closed for replies.

1 reply

ShiveringCactus
Community Expert
Community Expert
June 23, 2023

Try this (I've taken one of Dan Ebberts' expressions and adapted it).   I also added in Layer Controls to make it easier for naming conventions and simpler to swap out layers.

 

var sliderValue = effect("Slider Control")("Slider");
key = sliderValue.nearestKey(time).index
if (time < sliderValue.key(key).time) {
	key--;
}

parseInt(effect("Layer"+key)("Layer").text.sourceText);
Participant
June 23, 2023

Thank you, It's working. but I want to see the number counting between layer values.