Forum Replies Created

Page 8 of 24
  • Just realised when testing it, I didn’t write it the other way round.

    It wants to be 0 else 100

    🙂

  • Unless you’re trying to do something else with it.

    This should be fine.

    if(thisComp.layer(index+1).active == true) 100 else 0;

    for cc2019 as I’ve not upgraded. This should work based off what I’ve read.

    if(thisComp.layer(index+1).active == true){
    100
    } else {
    0
    };

  • Scott Mcgee

    November 27, 2018 at 9:00 am in reply to: AE Scripting: JSX parsing JSON file already in Project

    Quba

    I cracked it, this will work.

    You’ll have to adapt to get it to work for yourself. I just wanted it to alert an object in my Json to make sure it worked.

    var w = new Window(“palette”,”Test”,undefined,{resizeable:true});

    var btn2 = w.add(“button”,undefined,”submit”);

    var file = app.project.selection[0].file;
    file.open(“r”);
    var jsonString = file.read();
    file.close();

    var Obj = JSON.parse(jsonString);

    btn2.onClick = function(){
    alert(Obj.Name);
    };

    w.show();

    Mathias helped me, but it didn’t like eval, but using JSON.parse fixed it.

    So. After all that. Yes it can be done.

  • Scott Mcgee

    November 26, 2018 at 9:37 am in reply to: AE Scripting: JSX parsing JSON file already in Project

    Completely sorry.

    With it being such a new feature being able to import a json file as footage. I honestly don’t know.

    One would argue that if there was a way to do it via expression. That you should be able to definitely do it via script.

    Sorry for misunderstanding, but I think with it being a new feature importing json as footage. It’s going to be a case of trial and error.

    Mathias Moehl on adobe forums tends to be pretty good with that type of thing. If you want to try there, but all I’m find is expressions, or scripts that add expressions to layers to access the information.

  • Scott Mcgee

    November 24, 2018 at 9:02 am in reply to: AE Scripting: JSX parsing JSON file already in Project

    Ah, in that case.

    No.

    Alterations to comp and layer names can only be achieved via script. Or as far as I’m aware, but I’m pretty confident that can only be done by script.

  • Scott Mcgee

    November 23, 2018 at 1:12 pm in reply to: AE Scripting: JSX parsing JSON file already in Project

    Unsure what you are trying to do, but if you are in cc2018 or higher.

    This is an example of how you access the data from a JSON file that you bring into after effects.

    txt = footage(“TEST.json”).sourceData;
    txt.Name

    but as for json2.js that’s a script job, as far as I’m aware you can’t do that in after effects.

    Hope that helps

  • Scott Mcgee

    November 12, 2018 at 12:41 pm in reply to: link a layers Y position to another layers y scale

    If you want the green top layer to move on the y position.

    Someone might have a better expression to link something to the edge. But this is the idea you want.

    x = value[0]
    y = thisComp.layer(index+1).position[1] – thisComp.layer(index+1).sourceRectAtTime().height;
    [x,y]

    Making sure you anchorPoint is attached the bottom of the pink layer the is scaling up. This will position it to the top part of the shapeLayer.

    If you are using the scale[1]. You’ll need it to calculate the percentage

    x = value[0]
    y = thisComp.layer(index+1).position[1] – (thisComp.layer(index+1).sourceRectAtTime().height * thisComp.layer(index+1).scale[1]/100);
    [x,y]

    I’m sure someone else will have a tidier expression that works better, but this should do the trick for you if your anchorPoints are set up correctly

    Hope that helps.

  • Scott Mcgee

    November 12, 2018 at 12:28 pm in reply to: JSON Data expression problem

    Json is funny about spaces.

    I would write it like this personally.

    txt = footage(“Country.json”).sourceData;
    txt[“Country Name”]

    The above then allows for spaces.

    Normally if you didn’t have spaces in Country Name like this (Country Name), it would look like this.

    txt = footage(“Country.json”).sourceData;
    txt.CountryName

    Hopefully that helps

  • Scott Mcgee

    November 1, 2018 at 8:48 am in reply to: Multiple position ease expression

    Cheers Kalleheikki,

    I was hoping you would have had some magical expression I just couldn’t fathom on my own hahaha.

    I figured a way that might work. I’m just working on it this morning, but my test did work yesterday before I finished for the day.

    So I’ve precomped and auto cropped my precomps. Then my precomps in my Master. Items inside are triggered using an expression with a Marker.

    This seems to work seamless. But let’s see what happens when I add the next 23 layers.

    Again cheers for the input.

  • Scott Mcgee

    October 31, 2018 at 3:35 pm in reply to: Multiple position ease expression

    Hey Kalleheikki I can do one better. I’ve attached a gif

    https://media.giphy.com/media/p3BhMauADmaPP3OuDI/giphy.gif

Page 8 of 24

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