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

Control a slider with JSON value range

Explorer ,
Nov 25, 2018 Nov 25, 2018

Copy link to clipboard

Copied

I have a JSON file with a range of values from 416 - 423 which I want to use as the min and max of a slider, but still have the slider run from 0-100%.

Basically, I want the slider to read 416 and return 0 and read 423 and return 100.

Any ideas welcome. Thanks

TOPICS
Expressions

Views

996

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 , Nov 25, 2018 Nov 25, 2018

Assuming variable  n has the json value, you could do something like this:

n = // (your json value)

linear(n,416,423,0,100)

Dan

Votes

Translate

Translate
Community Expert ,
Nov 25, 2018 Nov 25, 2018

Copy link to clipboard

Copied

Assuming variable  n has the json value, you could do something like this:

n = // (your json value)

linear(n,416,423,0,100)

Dan

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 ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

Yes, as Dan suggested, you need to use the linear() expression.

See this tutorial for more details of how linear() can be useful for json data:

https://mamoworld.com/tutorials/data-driven-animation-json-after-effects-part-5-paths-and-graphs

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
Explorer ,
Nov 26, 2018 Nov 26, 2018

Copy link to clipboard

Copied

LATEST

Thanks Dan and Mathias,

I will test this later today and let you know if it does the job

Thanks

Justin

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