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

Change keyframes value using expression

New Here ,
Jun 23, 2023 Jun 23, 2023

Copy link to clipboard

Copied

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

Views

451

Translate

Translate

Report

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

Copy link to clipboard

Copied

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);

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

 

Votes

Translate

Translate

Report

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