Forum Replies Created

Page 57 of 65
  • Andrei Popa

    March 21, 2018 at 11:34 am in reply to: Check if any of selected layers is not a ShapeLayer

    I think i got your question wrong. If you need to check if any selected layer is not shape, you should use this function. The function returns false if at least one layer is not shapelayer, true otherwise.

    var myComp = app.project.activeItem;
    var numLayer = myComp.selectedLayers;

    //You call the function using your layers as parameter
    checkIfAllShapes(numLayer);

    //the function
    function checkIfAllShapes(layerArray) {
    for (i = 0; i < layerArray; i++) {
    if ((layerArray[i] instanceof ShapeLayer) == false) return false;
    }
    return true;
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2018 at 10:58 am in reply to: Check if any of selected layers is not a ShapeLayer

    Is this what you are looking for?
    var myComp = app.project.activeItem;
    var numLayer = myComp.selectedLayers;

    for(i=0;i

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2018 at 10:53 am in reply to: Count layers in a composition with a certain name

    I don’t know if this is the most efficient method, but it works.
    layerNumber = 0;//start the counting of layers at 0
    layerStartWith = "Image";//the word with which the layers should start
    for(i=1;i<=thisComp.numLayers;i++){
    if (thisComp.layer(i).name.slice(0,layerStartWith.length) == layerStartWith) layerNumber =layerNumber +1;
    }
    layerNumber

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2018 at 9:36 am in reply to: Select property only in certain property groups

    @Steve
    a=1;
    b=”1″;
    c=1;
    d=true;

    a==b true
    a===b false

    a==c true
    a===c true

    a==d true
    a===d false

    So using the ===, the values must be identical. Same value and same type. == converts the values and then checks if they are equal

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2018 at 9:30 am in reply to: Control the speed

    I don’t know if what you want is possible through a simple expression. The problem is that expressions don’t have memory. Once the timeline goes to the next frame, all that the expression calculated is lost, and the expression runs again. The problem with what you want is that the expression must remember how fast the flare went the frame before and the frame before and so on. In order to do that you would maybe need to create an expression that goes from the beginning of the comp and calculates every value until the present frame. On each frame. That would translate by an exponential increased render time for each second you have in your composition.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 15, 2018 at 4:24 pm in reply to: Is it possible to return a layer from a function ?

    If you declare the variable in the main code of the script, you should use the variable directly inside the function, without using it as an argument. This function uses the variable that you gave as an argument. Not the global one. Although they have the same name, they are different variables. And the return works as asigning the variable to something. Try something like
    var BpreNull;
    newNull = CreatepcNull(BpreNull, curBtwnComp, curBtwnComp.duration, BdestComp, q, threeD, BcName, BpreName);
    alert(newNull.name)

    OR

    If you do not want to use another variable, try removing BpreNull from the function arguments. And remove the return.
    Tell me if this worked. If not, we will figure it out.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 13, 2018 at 2:35 pm in reply to: Is scripting in extendscript language-dependent?

    Than you very much for this info. You spared me for hours of searching answers 😀

    Andrei
    My Envato portfolio.

  • Try this.
    layerPosition = thisComp.layer("Null 1").transform.position[1]; //here you put 1 for the y position or 0 for the x position. That depends on how you want to move your null(vertically/horizontally)
    botValue = 100;//the value of the position of the null where you want your value to be 0
    topValue = 800;//the value of the position of the null where you want your value to be 100
    numValue =Math.floor( ( (layerPosition-botValue) / (topValue-botValue) ) * 100)
    numValue

    Andrei
    My Envato portfolio.

  • numberPosition = thisComp.layer("number").transform.position;
    distance = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    tempY = numberPosition[1];
    tempX = numberPosition[0]+distance+thisComp.layer("number").sourceRectAtTime(time,false).width;
    [tempX,tempY]

    The first 2 variables should be “pick-whipped”. First is the position of your counter layer and second is the distance you want to aquire. Both layers should be left aligned.
    Another way would be to mjust make one solo layer. If you have an expression for your number, you should add ” views” to its value. Something like
    value + " views";

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 19, 2018 at 10:29 am in reply to: Checkbox activated “Wiggle Paths”

    Double checked. Silly me, i had another effect that doubled the first one, that is why it was still there. Thanks for the clarification.

    Andrei
    My Envato portfolio.

Page 57 of 65

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