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

Slider snapping to numbers

Community Beginner ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

Hey everybody,

 

I'm searching for a solution to the following problem:

I'm working on an kind of template for After Effects. It should be an After Effects woking file, where others can render some lower thirds from.
I want to use a slider to change the position of the text, so that the whole graphic is left, middle or right.
The slider already works on the position, so far so good. The problem is, that I want the slider to snap to the number, that the slider kind of jumps to the next round number, so that it isn't possible to position the slider between 0, 1 and 2. I already tryed Math.round(), Math.floor() and .value.toFixed, but it's not the final solution I was hoping for.
A script is not a solution, because it's way too complicated for the users.

Is there anything else I haven't found yet that could help me? Or is there a way to rename the position of the slider with 'left', 'middle' and 'right' instead of numbers?

Cheers, Elisa

TOPICS
Expressions

Views

1.7K

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

correct answers 2 Correct answers

LEGEND , Jan 31, 2020 Jan 31, 2020

If your company isn't letting you use the latest version with the Expression Dropdown meny controller (which, as @Mike_Abbott suggests, is the best way), you can use if/else expressions to make it snap to certain positions. 

Votes

Translate

Translate
Valorous Hero , Jan 31, 2020 Jan 31, 2020

Math.floor should work. It is quite likely your Expression is not written as it should. If you post the Expression, in its entirety, someone may be able to assist you, to provide a solution.

Votes

Translate

Translate
Advisor ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

Probably a better way to approach this would be with the new After Effects 'Dropdown menu control' expression controller.
You could use that to offer the three options: left, middle, right.

Rather than type out a whole list of instructions here, review this video for an intro:

https://youtu.be/nPTNtwSx9SE 

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
LEGEND ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

If your company isn't letting you use the latest version with the Expression Dropdown meny controller (which, as @Mike_Abbott suggests, is the best way), you can use if/else expressions to make it snap to certain positions. 

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
Community Beginner ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

Sorry, I forgot to mention that I have to use AE 2018.

It works, nearly as I wanted it to.
But now I can only use the number in the slider effect to change the postion. The slider itself is grey and I can't move it manually. Did I do something wrong?
I wrote the if/else expression directly to the slider effect, I hope thats right.

Thanks a lot! You already helped me and I learned something new! 🙂

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
Valorous Hero ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

Math.floor should work. It is quite likely your Expression is not written as it should. If you post the Expression, in its entirety, someone may be able to assist you, to provide a solution.

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV

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
Community Beginner ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

LATEST

Oh you're right. I alsways used Math.floor to round the number of the slider in the expression of the Position of my Nullobject. Now I've tried it for the slider effect itself as an expression and it worked!!! Yeay 🙂

Thank you so much!

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