Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions CSVs, MOGRTs, and limited colors

  • CSVs, MOGRTs, and limited colors

    Posted by Jon Miguel on October 15, 2020 at 5:33 am

    Hi there,

    I’m currently trying to create a mogrt that the user can select from a limited and specific number of colors for the fill layer. I’ve been trying to see if that would be most efficiently done using a CSV file since that seems to be the way I come across online but I haven’t found a complete answer.

    I currently have 5 colors in a csv file called “data-driven.csv” with cells filled appropriately with the hex code I want to use. that file is currently in my comp with a slider control because I want the user to be able to flip between the available colors and that seemed to be the easiest. My shape layer has this expression on it

    barColor = thisComp.layer(“data-driven.csv”)(“Data”)(“Outline”)

    (“Primary”)(“Primary 0”).toString();

    hexToRgb(barColor);

    I’m at the point where I know that the value “Primary 0” is what determines which cell the color is trying to look for to fill in the value. what I don’t know is how to link the area where it says “Primary 0” to the slider so that if I set the slider to 1, it’ll choose “Primary 0” of the csv file and if I set the slider to 3, it’ll choose “Primary 2” as so forth. it’s frustrating being so close to what I want to accomplish and still not there since I have not seen the full solution/explanation online.

    thanks in advance for any help

    Filip Vandueren replied 5 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    October 21, 2020 at 11:00 am

    something like this:

    sl=Math.floor(effects("Slider Control")("Slider").value) - 1;
    barColor = thisComp.layer("data-driven.csv")("Data")("Outline")("Primary")("Primary "+sl).toString();
    hexToRgb(barColor);

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