Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking Color Control to the Color value of a Solid Layer

  • Linking Color Control to the Color value of a Solid Layer

    Posted by Joshua Dowdy on August 17, 2019 at 7:23 pm

    First post!

    I’m working on a project where the client needs 100’s of copies of the same video but with titles and some graphics swapped out, and for the present issue, color schemes. I found Templater by Dataclay to swap out layers at scale, but I’m having an issue with the colors. Templater can swap out the colors of a solid using the Hex values, but as far as I know cannot be linked to an effect. So my idea is to have a few master solids that are linked to Templater, parent the color control panel to those solids, then parent the layers that need to change for each video to the color control. I know there must be a simple way to do this, but I’m brand new to using expressions and I can’t find anything online so far. All it needs to do is pull the hex value from a solid and paste it in the hex value for the color controller. Any ideas?
    Thanks!

    Josh

    Joshua Dowdy replied 7 years ago 2 Members · 4 Replies
  • 4 Replies
  • Tomas Bumbulevičius

    August 20, 2019 at 9:23 am

    Hey Joshua, you could do the following:

    1. From Templater, apply color hex to text layer, just a a string.
    2. Then link expression from that string to Fill’s effect.
    3. Expression encode hex to color.

    So this solution allows you to get rid of that ‘solids’ idea completely (which is limited, IMO, and not intuitive that much)

    function hexToColor(theHex){

    theHex = parseInt(theHex,16);

    var r = theHex >> 16;
    var g = (theHex & 0x00ff00) >> 8;
    var b = theHex & 0xff;

    return [r/255,g/255,b/255,1];

    }

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Joshua Dowdy

    August 25, 2019 at 11:36 pm

    Hi Tomas,
    Sorry for the late response. Got swamped at work this last week and I’m just getting back around to solving this issue.
    That’s clever. I did not even think about that. Thanks for sharing. It seems like that would be less layers and parenting/linking layers to each other to deal with than my idea?

    Which, btw, I did find an expression for that worked in a quick test I did:

    target = comp("SOURCE COMP").layer("SOURCE LAYER");
    samplePoint= [960,540]; // Sample location
    sampleSize= [1,1]; // Sample area (in pixels)
    target.sampleImage(samplePoint,sampleSize)

    Josh

  • Tomas Bumbulevičius

    August 27, 2019 at 9:32 am

    Hey Joshua, while the above works, sampleImage will be less efficient in terms of processing speed, than direct expression to Fill effect.

    I would suggest to test this out, compare and see the differences!

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Joshua Dowdy

    August 28, 2019 at 2:44 am

    Will do, thanks Tomas!

    Josh

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy