Forum Replies Created

Page 37 of 65
  • Andrei Popa

    March 7, 2020 at 8:30 am in reply to: Distribute evenly in a circle

    I don’t know about Motion2 Orbit, but for what you need i suggest this approach.

    On your layer(the one that orbitates on the circle) add a slider named Radius. This is the radius of the circle. Then add this to anchorpoint:

    var left = sourceRectAtTime(time,false).left;
    var myHeight = sourceRectAtTime(time,false).height;
    var myWidth = sourceRectAtTime(time,false).width;
    var top = sourceRectAtTime(time,false).top;
    [left+myWidth/2-effect("Radius")("Slider"),myHeight/2+top]

    Then add this to rotation.

    360/thisComp.numLayers*index

    This works in a comp where only the initial layer and its copies exist. But you can alter the code from the rotation a bit to fit any case.

    For example, you can replace thisComp.numLayers with the number of your copies.
    Or instead of index, you can writen index-n, where n equals the index of the first layer -1.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 6, 2020 at 8:33 am in reply to: Arrow point out position of other shape

    This to the rotation of the arrow:

    p2 = thisComp.layer("Arrow Layer").toComp([0,0]);
    p1 = toComp(anchorPoint);
    v = p2-p1;
    radiansToDegrees(Math.atan2(v[1],v[0]))

    This expression was offered as solution by Dan Ebberts in this thread

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 5, 2020 at 12:13 pm in reply to: launch script eval(file.read()) palette or dialog

    First, I would put an else after checking if the file exists. So the script doesn’t try to open the next script.

    Then, I think(not by far sure) that what happens is that you declare the second window inside the button variable. So i think the scope is what makes you trouble. I thin dialog has direct scope to the main app or something(since you can;t have 2).

    Long story short, if you declare your second window inside the main program, it works.

    File 1 :
    var w = new Window("palette", "script", undefined);
    var w2 = new Window("palette", "script", undefined);

    var btn = w.add("button", undefined, "Lauch");

    var file = new File("‎~/Desktop/test.jsx");

    btn.onClick = function () {
    if (!file.exists) {
    alert("WRONG LOCATIONS")
    } else {
    file.open("r");
    eval(file.read());
    file.close();
    }

    }

    w.show();

    File 2:
    var btn = w2.add("button",undefined,"TEST");

    w2.show();

    Andrei
    My Envato portfolio.

  • like this:

    app.project.activeItem.layer("your text layer")("ADBE Text Properties")("ADBE Text Document").setValue("Here is the new values of the text")

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 29, 2020 at 10:40 am in reply to: Link an image to a single letter?

    You can’t retrieve the position of a letter in a paragraph. The only way you could do what you want if you made a layer for each letter.

    Andrei
    My Envato portfolio.

  • Sholdn’t this be faster and easier?

    sourceText= thisComp.layer("Same text, But without The final line").text.sourceText;
    sourceText.split("\r").slice(0,-1).join("\r")

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 26, 2020 at 3:53 pm in reply to: Changing images using filenames from a JSON file

    If you have a league, lets say, you can put all the png in a composition and add an expression to the opacity, so they are only visible if they are in the JSON.
    One comp for each team(visiting/away)

    And in the JSON, instead of filename, you put the name of the team.

    Experssion should be something like this:

    Home team comp

    eval("var json=" + footage("json.json").sourceText);
    (json[match1team1icon]==thisLayer.name) ? 100 : 0

    Visiting team comp

    eval("var json=" + footage("json.json").sourceText);
    (json[match1team1icon]==thisLayer.name) ? 100 : 0

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 19, 2020 at 7:41 am in reply to: Forcing text inside Source Text is acting weird

    Try with this expression:

    maxW = thisComp.layer("ExpCTRL").effect("Max Text Length (px)")("Slider");
    txtW = sourceRectAtTime().width;
    (txtW <= maxW) ? value : "You have exceeded \rthe maximum length allowed."

    You should use “value” when addressing the property value before the expression. Because sometimes I think AE runs the expression again. And with your expression, the second time it runs, this.text.sourceText; is your error text which satisfies the first part of the if. Then, it’s too long again, then it must go with the second part again, etc.
    I hope I was clear enough.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 18, 2020 at 1:08 pm in reply to: PropertyValueType not working as expected

    I never thought about that. Maybe a point control? Or maybe some values that can’t expand to 3d. Surely there must be some in all the effects.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    February 18, 2020 at 11:06 am in reply to: Can I stop AE from throwing an error?

    And if i try to bypass the maxValue property by skipping this name i get an error on two different rows, which i did not even know was possible.

    Andrei
    My Envato portfolio.

Page 37 of 65

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