Forum Replies Created

Page 7 of 17
  • Alex Printz

    October 2, 2019 at 1:54 pm in reply to: Check layer is 3d or 2d

    Dan’s answer is what I do; I check the value’s array length of position or anchorPoint.

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 30, 2019 at 4:29 pm in reply to: tentacle made with createPath(points

    Oops, you forgot a paranthesis on your last point:

    targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*-(thickness)),

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 30, 2019 at 4:28 pm in reply to: tentacle made with createPath(points

    Try this, i’m guessing ‘path’ can’t be used as your variable since it’s usually a reserved word. EIther that, or in the createPath the ‘=’ symbols are breaking your code.

    thickness = 100;
    targetPath = thisComp.layer("Driver").content("Tracé 1").path;
    pList = [
    targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*thickness),
    targetPath.pointOnPath(0.2) + (targetPath.normalOnPath(0.2)*(thickness*.8)),
    targetPath.pointOnPath(0.4) + (targetPath.normalOnPath(0.4)*(thickness*.6)),
    targetPath.pointOnPath(0.6) + (targetPath.normalOnPath(0.6)*(thickness*.4)),
    targetPath.pointOnPath(0.8) + (targetPath.normalOnPath(0.8)*(thickness*.2)),
    targetPath.pointOnPath(1),
    targetPath.pointOnPath(0.8) + (targetPath.normalOnPath(0.2)*(thickness*-.2)),
    targetPath.pointOnPath(0.6) + (targetPath.normalOnPath(0.4)*(thickness*-.4)),
    targetPath.pointOnPath(0.4) + (targetPath.normalOnPath(0.6)*(thickness*-.6)),
    targetPath.pointOnPath(0.2) + (targetPath.normalOnPath(0.8)*(thickness*-.8)),
    targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*-(thickness),
    ];

    createPath(pList, [], [], true)

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 17, 2019 at 5:16 pm in reply to: Find layers which are linked to property by expression

    you could look at the pt_ExpressEdit plugin, it has a search feature for expressions, you might be able to get some ideas from how that works.

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 6, 2019 at 8:49 pm in reply to: control path length using expressions

    I have built a trim paths expression to do this in the past.

    IIRC, you need to make a slider to set the ‘full’ length, then create a loop that measures the distances between pointOnPaths on a spline and adds them together, compares that to the ‘full’ length, and if the current spline is measured longer than that trim that percentage. I used a 2nd slider to set the number of points to compare (I think I liked around 12 or so, not too many to bog the system, not too few to look choppy)

    It worked well for what I needed to do (swinging rope I think?)

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 4, 2019 at 9:12 pm in reply to: How do you look up line numbers in a JSON file?

    Try following something like this, it’s been a while since I made a JSON from scratch:

    https://lesterbanks.com/2018/09/create-json-file-ae/

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 3, 2019 at 6:29 pm in reply to: How do you look up line numbers in a JSON file?

    “AbileneChr” : {
    “TEAM”: “Abilene Chr”,
    “MASCOT”: “Wildcats”,
    “LOGO”: “ABILENE_CHRISTIAN”
    },
    “AirForce”:{
    “TEAM”: “Air Force”,
    “MASCOT”: “Falcons”,
    “LOGO”: “AIR_FORCE”
    },

    I meant.

    I don’t think you can create a loop through a json to look for items and compare by names; JSON is an unordered property, so it needs to be called directly through a string. There is no index count to go through.

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 3, 2019 at 6:21 pm in reply to: How do you look up line numbers in a JSON file?

    Yeah, all you have to do is this:

    AbileneChr{
    “TEAM”: “Abilene Chr”,
    “MASCOT”: “Wildcats”,
    “LOGO”: “ABILENE_CHRISTIAN”
    },
    AirForce{
    “TEAM”: “Air Force”,
    “MASCOT”: “Falcons”,
    “LOGO”: “AIR_FORCE”
    },

    jsonData.AbileneChr.MASCOT

    just make each category the team name without spaces. Format however you want. You could either make your scripts parse out and space characters, or just don’t type them into your text box when you tell it what to grab.

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 3, 2019 at 5:05 pm in reply to: How do you look up line numbers in a JSON file?

    I think if you create object names prior to your properties of that object, you should be able to easily call them (scrub through a slider, etc.):

    “1” : {
    “TEAM”: “Abilene Chr”,
    “MASCOT”: “Wildcats”,
    “LOGO”: “ABILENE_CHRISTIAN”
    },
    “2” : {
    “TEAM”: “Air Force”,
    “MASCOT”: “Falcons”,
    “LOGO”: “AIR_FORCE”
    },

    then you just call it like this:

    jsonData.1.LOGO

    Alex Printz
    Mograph Designer

  • Alex Printz

    September 3, 2019 at 4:06 pm in reply to: Get rotation value of layer that is oriented along path

    L should be the layer you want to target that is orientated to a path:

    L=thisComp.layer("LayerOrientatedToPath");
    v = L.toWorldVec([1,0,0]);
    if(hasParent) v = parent.fromWorldVec(v);
    radiansToDegrees(Math.atan2(v[1],v[0]))

    Alex Printz
    Mograph Designer

Page 7 of 17

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