ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Data Driven Animation: get Color from Json

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alex Weil
Data Driven Animation: get Color from Json
on Jun 11, 2018 at 4:30:33 pm

Hey folks

i have a color in my Json file

{
"textcolor": "[255,0,255,255]"
}

now in my footage i got the "textposition" field with an expression on it. how do i get the color informations out of it and apply it to a fill effect on a different Layer?

cheers
Alex


Return to posts index

Dan Ebberts
Re: Data Driven Animation: get Color from Json
on Jun 11, 2018 at 10:21:53 pm

I can't exactly picture what you're describing, but if you import your json file, you could then use something like this on the color property:

data = footage("your_json_file.json").sourceData;
eval(data.textcolor)/255

Note that if you had your color data as an array instead of a string, like this:

{
"textcolor": [255,0,255,255]
}

you could eliminate the eval() in the color expression:

data = footage("your_json_file.json").sourceData;
data.textcolor/255



Dan



Return to posts index

Alex Weil
Re: Data Driven Animation: get Color from Json
on Jun 12, 2018 at 7:41:57 am

sorry, had some little failures in my text ... sorry, i meant "textcolor"

i tried to say, that i only have an expression on the layer, that says "footage("test9.json").dataValue([9])" but there was no data that i can use to pick my color from.

thanks to your answer, i erased the quotation marks from the array and now i got some nice usable data ☺
thanks dan


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]