Forum Replies Created

Page 12 of 24
  • I don’t know your layout for your Json, but this is the idea behind it. Also I’ve just copied and pasted the colours I used for a weather map. So you’ll want to look at what colour values you’d want.

    txt = footage(“file.json”).sourceData;
    input = txt.zone1

    if ( input <= 5 && input >= 0 ){
    ([0,255,210,255]/255)}
    else if ( input <= 10 && input >= 6 ){
    ([0,255,190,255]/255)}
    else if ( input <= 15 && input >= 11 ){
    ([0,255,170,255]/255)}
    else if ( input <= 20 && input >= 16 ){
    ([0,255,150,255]/255)}
    else if ( input <= 25 && input >= 21 ){
    ([232,255,0,255]/255)}
    else if ( input <= 30 && input >= 26 ){
    ([252,210,0,255]/255)
    }else{
    ([255,255,255,255]/255)};

    If you are clever about it, you could label your layers and use

    a = thisLayer.name
    txt = footage(“file.json”).sourceData;
    input = txt[a]

    This would allow you to just copy and paste the expression onto all layers and you layer names will trigger that.

  • Scott Mcgee

    July 10, 2018 at 2:11 pm in reply to: Slider control with divisions.

    Have you got an example of what you want to do. I can think of a few things you might be suggesting you want to do.

  • Scott Mcgee

    July 6, 2018 at 7:36 am in reply to: duplicate solid and move in ‘y’ position

    The below link give you the feature so that your first one that it’s basing it’s position off doesn’t flag an error as it doesn’t have a index to refer to. The everything after that (Duplications) will – 10 on the y axis and stay linear on the x.

    try{
    x = thisComp.layer(index+1).transform.position[0];
    y = thisComp.layer(index+1).transform.position[1] – 10;
    }catch(err){
    x = value[0];
    y = value[1];
    }
    [x,y]

  • Sorry I missed the bit about you using sourceText.

    If it’s for someone else to use that isn’t after effects savvy. I sometimes put in an alert feature that tells them it isn’t a number.

    for sourceText layer
    a = thisLayer.text.sourceText
    if(isNaN(a)){
    “THIS IS NOT A NUMBER”
    }else{
    text.sourceText;
    }

    also if the text layer is to be hidden. I also add this to it to the opacity.

    a = thisLayer.text.sourceText
    if(isNaN(a)){
    100
    }else{
    0
    }

    It’s nothing flashy, but for someone who doesn’t know how to use it and wonder why it isn’t working, does come in handy.

  • As long as your shape to start is 100% and 100% of the bar graph. Then you just need to copy and paste this into your scale of the transform properties.

    Then yb = pickwhip your slider control.

    transition = 1
    ya = 0;
    yb = effect(“Slider Control”)(“Slider”);
    x = 100;

    if(time < (inPoint+outPoint)/2){
    ease(time,inPoint,inPoint+transition,[x,ya],[x,yb]);
    }else{
    ease(time,outPoint -transition,outPoint,[x,yb],[x,ya]);
    }

  • Scott Mcgee

    July 3, 2018 at 9:36 am in reply to: Adjusting text length through expression

    So how the expression works

    if (thisComp.layer(“Text Layer”).text.sourceText.length >= 61)
    This is looking at length and seeing if it is larger or equal to the number of characters. If It does, then it goes to the next part.

    for (i = 61; i > 0; i–) if (txt[i] == ” “) break;
    This then triggers and goes through all the characters up to 61 and stops at the last text break/space (If it doesn’t then you’ll find the line breaks words in two)

    if (i > 0)
    txt.substr(0,i) + “\r” + txt.substr(i+1)
    else
    txt.substring(0,61) + “\r” + txt.substring(62,999)
    This defines which line it’s breaking it to.

    But this only works for two lines, if you want more lines then you’ll have to adapt it. If you go to the link I sent, this does similar expression for multilines, and bases it’s w

  • Scott Mcgee

    July 2, 2018 at 7:30 am in reply to: Adjusting text length through expression

    https://forums.creativecow.net/thread/227/33411

    If you take a look at the above thread, although this also scales text it paragraphs it. Have a look at the expression coding for this. This would be a good place to start if you can’t find anything else.

  • Scott Mcgee

    June 22, 2018 at 8:25 am in reply to: For through expression

    I couldn’t get it to work the way you suggested.

    I figured a way to cheat it using the opacity

    I’m going to be expanding this to base itself on comp name as I’ll have a few different version, but I use this in my sourceText

    try{
    footage(“Bruntingthorpe data.csv”).dataValue([1,0]);
    }catch(e){
    “”
    }

    Then this is my opacity for Column One

    x = null;
    for ( i = index+2; i <= thisComp.numLayers; i++){
    try{
    L = thisComp.layer(i)
    if(L.text.sourceText.length < 1 || text.sourceText.length > 1){
    x = 100;
    }
    break;
    }catch(err){
    if(text.sourceText == “”){
    x = 0;
    }else{
    x =100;
    }
    }

    Then the first row item of column two

    x = null;
    for ( i = index+1; i <= thisComp.numLayers; i++){
    try{
    L = thisComp.layer(i)
    if(L.transform.opacity == 100) continue;
    if(L.transform.opacity == 0){
    x = L.transform.position[0];
    }
    break;
    }catch(err){
    }
    }
    [x,value[1]]
    }
    x

    Then everything then follows that item with a basic position expression.

    It’s a messy way of doing it, but it works.

  • Amazing.

    I can’t believe how I can understand so much of these expression yet For through expressions I struggle so much. Is there anywhere that has a better understand of how to use them?

    I’ve read most scripting guides and never find anything about them, yet I’m finding myself using them more and more.

    Cheers for that though, that does exactly what I want it to do.

  • Could you adapt this so it breaks. For example you have 10 layers. 5 of them layers have the same name.

    The result would come back with something like this. I really still can’t get my head around for through expressions

    Bar1 = 1
    Bar2 = 1
    Bar3 = 1
    Bar1 = 2
    Bar4 = 1
    Bar1 = 3
    Bar6 = 1
    Bar7 = 1
    Bar1 = 4
    Bar1 = 5

Page 12 of 24

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