Skip to main content
Participant
June 23, 2023
質問

Change keyframes value using expression

  • June 23, 2023
  • 返信数 1.
  • 663 ビュー

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)

このトピックへの返信は締め切られました。

返信数 1

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.