Forum Replies Created

Page 16 of 24
  • Scott Mcgee

    January 10, 2018 at 8:21 am in reply to: Move, hold, move based on layer duration

    You can tell I don’t read posts thoroughly.

    If you got that to work brill.

    An alternative, as well is (time < (inPoint + outPoint)/2) which simply means, if I’m before the middle of the layer. I use this a lot, for scaling and position, but I’ve never had to go to a third point.

    t =.25;

    posa = [0,0];
    posb = [100,100];
    posc = [100,200];

    if(time < (inPoint + outPoint)/2) {
    ease(time,inPoint,inPoint + t,posa,posb)
    }else{
    ease(time,outPoint – t,outPoint,posb,posc)
    }

    it makes no difference really i think… With me still getting used to expressions 2 years later < or >…they break my brain haha, as I don’t know if they have a significant difference to writing it < or >.

    Anyways…Glad it’s working.

  • Scott Mcgee

    January 9, 2018 at 9:16 am in reply to: Move, hold, move based on layer duration

    There is probably better ways to do this.

    a is when you want the animation to happen, I’ve included inPoint of the layer, so that if you move the layer, it’ll re adjust itself.
    t is the time the animation will last.
    posa is the first position
    posb is the second position it will hold on
    posc is the final position

    a = 4;
    t =.5;

    posa = [0,0];
    posb = [100,100];
    posc = [100,1000];

    if((time > inPoint) && (time < inPoint + a)){
    ease(time,inPoint,inPoint+t,posa,posb)
    }else{
    ease(time,inPoint + a,inPoint + a + t,posb,posc)
    }

    Like I said, there is probably an easier method, but this is how I would do it currently at my level of expertise.

    Hope this is of use

  • Main one I’d use is a “if” expression tied in with either a checkbox or text layer. If you select top, middle or bottom it uses the relevant expression instead based on that.

    Might not be the best way of doing it possibly, but that’s the way I would do off the top of my head.

    This is how I would write it for text reference.

    if (thisComp.layer(“TMB”).toLowerCase == “top”){
    use top expression
    }
    else if (thisComp.layer(“TMB”).toLowerCase == “middle”){
    use middle expression
    }
    else if (thisComp.layer(“TMB”).toLowerCase == “bottom”){
    use bottom expression
    }

    obviously if you want to use checkboxes, just rewrite for that.

  • Haha,

    No i did not spot that.

  • Not too sure what’s wrong with yours.

    But I’ve re written it to work for me.

    txt = comp(“master”).layer(8).text.sourceText;
    if(txt == “”){
    effect(“Fill”)(“Color”)
    } else {
    txt = “0x” + thisComp.layer(“Colour”).text.sourceText;
    r = txt >> 16;
    g = (txt & 0x00ff00) >> 8;
    b = txt & 0xff;
    [r,g,b,255]/255
    }

    Altered for you

    txt = thisComp.layer(“Colour”).text.sourceText;
    if(txt == “background color”){
    effect(“background color”)(“Color”)
    } else {
    txt = “0x” + thisComp.layer(“Colour”).text.sourceText;
    r = txt >> 16;
    g = (txt & 0x00ff00) >> 8;
    b = txt & 0xff;
    [r,g,b,255]/255
    }

  • Scott Mcgee

    November 29, 2017 at 11:19 am in reply to: Parent Identify

    Hey

    A few things are wrong with this

    a few notes

    1: capital I in if, won’t work.
    2: it should be thisLayer.parent, rather than the other way round.
    3: if the parent exists .hasParent is the way to write this rather than “= 1”
    4: because x and y exists at the bottom rather than in the top part of if, wiggle needs to have x and y values, which is doesn’t

    l=thisLayer;
    if (l.hasParent){
    x = l.parent.position[0];
    y = value[1];
    [x,y];
    } else {
    wiggle(1,10);
    }

    This should work

  • Scott Mcgee

    October 12, 2017 at 1:30 pm in reply to: if/else exists expression

    I am a moron….

    I even tried a try/catch, but did it every wrong way possible, even when you posted that I did it wrong initially again and realised I have to put it in the loop for it too work, because I want to reference 4 categories I’ve been trying to put the try outside of it.

    That is working sport on now.

    Thank you for putting that, I would have gone around in circles otherwise.

    for (var i = 1; i <= myComp.numLayers; i++){

    try{
    var nNum = myComp.layer(i).effect(“Name”)(“Slider”).value;
    var name = myObject[nNum].name;
    myComp.layer(i).name = name;
    }catch(err){
    continue;
    }
    };

    for (var i = 1; i <= myComp.numLayers; i++){

    try{
    var lNum = myComp.layer(i).effect(“Location”)(“Slider”).value;
    var location = myObject[lNum].location;
    myComp.layer(i).name = location;
    }catch(err){
    continue;
    }
    };

    Unless you can think of a tidier way for this…I only have to do it 4 times and it’s only a find and replace. Last year I typed 480 text layers out, I’m doing it again this year and giving myself RSI hahahaha.

    Appreciate that.

  • Scott Mcgee

    October 5, 2017 at 7:25 am in reply to: Specific word in paragraph be a different color

    Cheers Liam for asking and Dan for answering.

    This is exactly what I wanted and it works. With a few alterations. Honestly didn’t think that putting .indexOf at the end of the open square brackets would work…But I gave it a try and it did.

    words = text.sourceText.replace(/^\s+/, “”).split(/\s+/);
    if (words[textIndex-1].indexOf (“@”) >-1) 100 else 0

  • This works, but if you hit return on the very first character, or if you delete the space that at the end of the line, it shifts the colour forward one otherwise it works…Yay

    try{
    myChar = “”;
    for (i = textIndex; i > 0; i–){
    thisText = text.sourceText.replace(/\r?\n|\r/g, ‘ ‘).replace(/\s{2,}/g, ‘ ‘);
    c = thisText[i-1];
    if (c == ” “) break;
    myChar = c;
    }
    if (myChar == “@” || myChar == “#”) 100 else 0
    }catch(e){
    value
    }

  • Funnily enough though, if I treat is as a textbox, when it wraps the text…It’s not affected that way.

Page 16 of 24

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