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

Change keyframes value using expression

New Here ,
Jun 23, 2023 Jun 23, 2023

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)MicrosoftTeams-image.png

TOPICS
Expressions
567
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 ,
Jun 23, 2023 Jun 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.

helped.jpg

 

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);
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
New Here ,
Jun 23, 2023 Jun 23, 2023
LATEST

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

 

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