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

Increase Slider value from another layer.

New Here ,
Oct 26, 2021 Oct 26, 2021

I want to make a score counter for two teams. I have a counter (slider) for the first command and for the second, they are in the same layer (number 1). In other layers, I do some mathematical actions as a result of which I need to increase the value of one of the sliders. Each subsequent layer should do the same. Probably there should be a function that will increase the value of one of the slider, and it can be called from any layer and it will increase the value of the slider.

 

const scaleController= thisComp.layer("scoreleft").effect("scoreleft")("Slider");
$.newScale = 59;
scaleController, 0, 100, [$.newScale+1];
TOPICS
Expressions , Scripting
672
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 27, 2021 Oct 27, 2021

Why do you even declare a constant, within expressions code of all things? That makes no sense whatsoever. You also have not explained sufficiently how your setup is actually structured. Generally, though, it seems to me you are misunderstanding how expressions work in that a) evaluation is strictly downstream and b) all properties have to be explicitly linked. So whatever you have in mind would likely simply boil down to adding a +1 and pickwhipping your counter slider. At any rate, you have to offer a better explanation and more info.

 

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 27, 2021 Oct 27, 2021

Are you talking about writing a script or expressions?

Expressions can only change the value of the property to which they are applied. There is nothing like an expression on a property that changes the value of a slider (except if the expression is applied to the slider itself).

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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
Contributor ,
Oct 29, 2021 Oct 29, 2021
LATEST

I do not know what you are trying to do, but here's something that might help. You can use the pick whip to easily link a value to another, even those in different comps.
2021-10-29 20_07_41-Adobe After Effects 2022 - Untitled Project.aep _.png

 

After that, you can easily do your math thingy. Hope this helps!2021-10-29 20_08_04-Adobe After Effects 2022 - Untitled Project.aep _.png

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