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
Assuming variable n has the json value, you could do something like this:
n = // (your json value)
linear(n,416,423,0,100)
Dan
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
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
Copy link to clipboard
Copied
Thanks Dan and Mathias,
I will test this later today and let you know if it does the job
Thanks
Justin