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

How to code a scroll in an After Effects Script?

Explorer ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

I'm curious if it is possible, what I suppose, to create a scroll bar when the window is at a certain height.

I hope someone can help me out with this issue.

TOPICS
Scripting

Views

2.9K

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 1 Correct answer

Community Expert , Mar 23, 2019 Mar 23, 2019

I still don't understand.

Are you writing a script for AE? Are you working with expressions? Are you trying to look at the timeline? Have you spent any time with the user guide?

Please post a screenshot of your problem. Just PrintScreen and Paste to the forum or drag a screenshot to the forum. That's all it takes.

Votes

Translate

Translate
Community Expert ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

Scroll? Left to right movement?

Try adding this expression to position:

t = time;

s = 300; // number of pixels you want to move per second

v = t * s

[value[0] + v, value[1]]

Here's how that works. In expression language, "time" returns the running time of the layer from the start of the composition. You just multiply time by however many pixels you want the layer to move in one second. If you are working in an HD comp then it is 1920 pixels wide. 1920 / 5 = 384 so if you set the speed to 300 it will take a little longer than 5 seconds for the layer (text) to scroll from left to right. Use whatever value you want for s.

Then there is just a simple multiplication function. Time in seconds multiplied by the speed gives a value we can add to the X value of the layer. This gives us the 'v' value.

The most confusing part of this expression for a newbie is the array at the bottom. I'll break that down. X and Y values for position are always in an array. value[0] is the current x value, value [1] is the current y value. If the layer was 3D there would also be a value for z and that would be described as value[2]. So the last line of the expression reads like this:

Take the current value of X and add to it the product of multiplying time by the speed in pixels per second you want for movement but just keep the current value for Y.

I hope that makes sense.

If you want a roll instead of a scroll just change the last line, the array so 'v' is subtracted from value[1]. If you are doing a scroll or a roll you always want to move the layer an even number of pixels so never use something like 250.5 for a speed value. You will have aliasing issues with fine lines and could easily introduce a stroboscopic visual effect called Judder, which makes scrolling or rolling text layers look pretty awful.

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
Explorer ,
Mar 23, 2019 Mar 23, 2019

Copy link to clipboard

Copied

I actually meant to add a vertical scrollbar because the script is too high to fit the dimensions of my laptop screen and with that scrollbar I can keep the window at a defined height and everything that doesn't fit within that size is viewable by scrolling down.

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 Expert ,
Mar 23, 2019 Mar 23, 2019

Copy link to clipboard

Copied

I still don't understand.

Are you writing a script for AE? Are you working with expressions? Are you trying to look at the timeline? Have you spent any time with the user guide?

Please post a screenshot of your problem. Just PrintScreen and Paste to the forum or drag a screenshot to the forum. That's all it takes.

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 Expert ,
Mar 23, 2019 Mar 23, 2019

Copy link to clipboard

Copied

See this thread for a general description of how to add a scrollbar to the panel of a script:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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 ,
Jan 10, 2022 Jan 10, 2022

Copy link to clipboard

Copied

Hi,

I'm interested in the thread you mentioned: (add a scrollbar to the panel of a script),  but I don't see a link. Please can you repost.

 

Thanks!

 

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
Engaged ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

Hi Mathias, can you post the link please?

 

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
Engaged ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

LATEST

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