ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Link Color of Anything to Solid's Color

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kiryla Chilko
Link Color of Anything to Solid's Color
on Mar 25, 2016 at 9:39:43 pm

Hi there!

I'm using the plugin called Templater. It allows you to use data from Google Datasheets to change some layers (like text/pitures, etc.). But it's not the point.

The point is it can only change colors of solids, not shape layers or anything else. But I want colors in my composition to be editalble so I want to link colors of text and shape layers to the solid's color. I believe there is way to do this, but the problem is I have no idea how. You can't take a pick whip and simply link the colors because solids have no such property as 'color' or 'fill'.

Maybe there is a way to do this with an expression? I would be much grateful for any help or advice.


Return to posts index


Kevin Camp
Re: Link Color of Anything to Solid's Color
on Mar 25, 2016 at 10:11:31 pm

you might be able to get away with using the compound arithmetic effect. just add that to you shape layer, then select the solid that you want to get the color of as the 'second source layer'. it will add a copy of that solid directly over the shape layer. this will cover any stroke though....

there is also function called sampleImage() that can sample the color of a layer.

you could apply it directly to the color property of the shape layer like this:
target = thisComp.layer("Your Solid"); // change this to the solid to sample
target.sampleImage(target.anchorPoint, [1,1], true, time)

or, if you have a whole lot of shape layers to change the color of, you might be able to save some cpu cycles by just adding a color control effect (from the expression controls effects) directly to the solid and add this expression to the color control'c color property:
sampleImage(anchorPoint, [1,1], true, time)
then use the expression pickwhip for the color properties of the shape layers to like them to the color control.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Kalle Kannisto
Re: Link Color of Anything to Solid's Color
on Mar 26, 2016 at 9:11:40 am

Would it help to add a fill effect to the solid? Then you'd have something to pick whip.


Return to posts index


Kiryla Chilko
Re: Link Color of Anything to Solid's Color
on Mar 26, 2016 at 12:33:23 pm

Kenin, thak you so much! You saved my day!

sampleImage(anchorPoint, [1,1], true, time)

This one works perfectly well.


Return to posts index

Kiryla Chilko
Re: Link Color of Anything to Solid's Color
on Mar 26, 2016 at 12:40:11 pm

And dear Kevin, sorry for misspelling your name.


Return to posts index

Chris Thomas
Re: Link Color of Anything to Solid's Color
on May 24, 2018 at 4:49:25 pm

Had the same same conundrum, you guys nailed it. Thanks!


Return to posts index

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