Forum Replies Created

Page 13 of 24
  • Something like this is what you need where the values between the two keyframes can animate like Chris has suggested.

    if (numKeys > 1){
    t1 = key(2).time;
    t2 = key(3).time;
    v1 = transform.opacity;
    v2 = effect(“Slider Control”)(“Slider”)
    linear(time,t1,t2,v1,v2);
    }else
    value

  • It is.

    I don’t know if your way will work, but I know it is possible to automate video creation.

    In my last job, we had a server set up with a trigger for aerender. Once launched this would export 8 video files, 1 after the other. This then exported to a specific folder. Because we wanted .mp4, we had that folder set up as a watch folder. This then converted those files and sent them to the broadcast team.

    I suggested using a trigger for a script file to make the alterations, but the risk of it not working over the above wasn’t viable as no one would be in for 4-5 of the export batches, but we just didn’t test it.

    We also looked but never finished it (I got another job), an online application form using PHP to develop a json file. Once uploaded, we would use another PHP form that would see the update and trigger aerender automatically, but the worry was it clashing. So my PHP developer was going to set up a queuing system. So that is all possible.

    My colleague also set up the system to then upload the content online and it would automatically embed it to the website.

    So there isn’t anything you’re asking that isn’t impossible. We were considering what you’re suggesting, but the facilities was going to cost us thousands to do it right and neither of us had the starter funds. So I hope it goes well for you when you do set it up.

    If you want a consultation. You know all the parts I know, but I could put you in touch with someone who give you a quote if you needed additional support in setting it up.

  • Scott Mcgee

    June 4, 2018 at 2:52 pm in reply to: JSON Data – how to access it from a text layer

    That’s fair enough, my machine was fine with the data, but if it’s a burden. Can completely understand.

    var name = myObject[0].name;

    So you’ve seen how to pull the info. Add to your script.

    I used it this way, but I wouldn’t say it’s the best. That was to change the layers name and using sourceText to use the Layers name as it’s text.

    var myComp = app.project.activeItem;
    myComp.layer(1).name = name;

    if you want to import the value into source text. Same thing

    var myComp = app.project.activeItem;

    but then you need to use something to reference. Wether you aren’t making changes to the layers number

    myComp.layer(1).property(“Source Text”).setValue(“Test”);;

    or if you layers name is always going to be the same.

    myComp.layer(“layers name”).property(“Source Text”).setValue(“Test”);

    Now you can do this as a for loop expression, but not going to lie, I’ve not used that in this context and I’m relatively new to this myself, but this should get you started hopefully.

    Another way to look at it maybe as well is with keys at the front. Again, I’ve used that with 2018 but not with a script at all. That could be another way to look at it so you could reference layer based on name.

    myObject[0].name
    myObject[1].name
    myObject[2].name

    so it would look more like this

    myObject.james.name
    myObject.scott.name
    myObject.sam.name

    This you could then use in an expression that would again loop through all the layers and if it sees any with that key in as the layer name could use that.

    Sorry for the waffle but other than this, I used cc2018.

    var name = myObject[0].name;
    var myComp = app.project.activeItem;
    myComp.layer(1).property(“Source Text”).setValue(name);

  • Scott Mcgee

    June 4, 2018 at 11:32 am in reply to: JSON Data – how to access it from a text layer

    Out of curiosity, is there a reason why you are not just using CC2018 that includes the ability to read JSON data.

  • Scott Mcgee

    May 31, 2018 at 11:21 am in reply to: How do you dock certain Script UI Panels?

    Is there a way to make your panel dockable when launched through another.

    To keep my script tidy and separate. I have a few different scripts that are launched via a menu.

    Is there a way to make these dockable?

  • Scott Mcgee

    May 31, 2018 at 8:34 am in reply to: Array .onClick

    Mainly because I found a work around, but if anyone can suggest a tidier way to write this.

    I discovered another forum page that used this.

    b[0].myParameter = 0;
    b[1].myParameter = 1;

    for(var i = 0; i <= 1 ; i++ ){
    b[i].onClick = function() {
    app.beginUndoGroup(“AddEffect”);
    var curItem = app.project.activeItem;
    var selectedLayers = curItem.selectedLayers;

    try{
    var curRem = curItem.selectedLayers[0].effect.property(“Fill”).remove();
    var curLayer = curItem.selectedLayers[0].Effects.addProperty(“ADBE Fill”)(“Color”).setValue(pcolor[this.myParameter])
    }catch(err){
    var curLayer = curItem.selectedLayers[0].Effects.addProperty(“ADBE Fill”)(“Color”).setValue(pcolor[this.myParameter]);
    }

    app.endUndoGroup();
    }
    }

    This works how I want it to, but I still have to write

    b[0].myParameter = 0;
    b[1].myParameter = 1;
    b[2].myParameter = 2;

    bar putting this into a for loop itself I’ve saved over 350+ lines, but I want to try and save an additional 23 if I can, but I guess I’m just nit picking.

    If anyone has a suggestion. I’d be grateful.

  • Scott Mcgee

    May 24, 2018 at 1:48 pm in reply to: Expression error although expression works

    That fixed it, as soon as I saw the && part I thought. *facepalm*

    Cheers that helped.

  • Scott Mcgee

    April 19, 2018 at 9:42 am in reply to: How to replace one line of code in multiple layers?!

    I create a expression control comp and keep all my expression layers in there and tie them us using something like this to the multiple layers

    eval(comp(“1 – Control Center”).layer(“City”).text.sourceText.toString())

    then if I need to make any changes I go to my expression control comp and make the alterations there, once updated. this updates all the layers it’s need for.

    Hope that helps

  • Not exactly sure but I’ll take a stab at it.

    Is there any reason why you are precomping.

    me personally for what I think you are using this for.

    I’d create a shape layer and use the expression to resize the box based on that. Then fix the text’s position to the shape layer.

    Put your text layer directly above the shape layer.

    This then needs to be pasted into the shapes rectangle path size. I’ve included padding for breathing space.

    padding = 20;
    x = (thisComp.layer(index-1).sourceRectAtTime().width + padding) * thisComp.layer(index-1).transform.scale[0] /100;
    y = (thisComp.layer(index-1).sourceRectAtTime().height + padding) * thisComp.layer(index-1).transform.scale[1] /100;
    [x,y]

    To lock the position, if you want it to scale from the center.

    Anchor Point (This goes onto both, so when the size changes the anchor point always remains central)

    r = sourceRectAtTime();
    [r.left + r.width/2, r.top + r.height/2]

    Then make shape layer fixed to the text layer so you can move it around.

    x = thisComp.layer(index-1).transform.position[0];
    y = thisComp.layer(index-1).transform.position[1];
    [x,y]

    If you want it left or right aligned, just play with the anchor point on both layers.
    Hope that is what you need.

  • Scott Mcgee

    April 6, 2018 at 7:51 am in reply to: control multiple positions with expression

    There is no purpose to this, I just use it to define a location. A lot of the time I want items to be directly central (thisComp.width/2, thisComp.height/2). You would just replace this with your x and y coordinates.

    Dan Ebberts wrote and expression that simulates exponential (bezier), you just need to fiddle with it a little bit, I could get it to work between the keyframes I wanted it to, but it kept breaking outside.

    decay = 3
    t = key(1).time;
    key(2).value + (key(1).value-key(2).value)/Math.exp(decay*(time-t));

    which you could look at incorporating

Page 13 of 24

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