Forum Replies Created

Page 1 of 3
  • Demarc Johnson

    August 4, 2020 at 5:13 am in reply to: turn effects off/on by name through scripting

    You should be able to do it with the code below. Just replace the layer name with the actual name of your layer. Change the boolean to true if you want the effect to be on and false for off.

    app.project.activeItem.layer("layer name").effect("CC Image Wipe").enabled = true; // Replace the layer name to actually name of the layer
    //True to turn on the effect and false to turn off the effect

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    August 4, 2020 at 4:43 am in reply to: Y Position set value from top of comp

    If I’m reading this right you should be able to do this by going to your anchor property and pasting the first line of code. Then go to your position property and paste the second line of code.

    The value[0] for both the anchor and the position will allow you to move or animate in the x axle

    [value[0], 0] // This code is for the anchor property
    [value[0], 100] // This code is for the position property

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 10, 2017 at 12:48 am in reply to: Atom text editor for after effects scripting

    Yesterday, I did seen a plugin for Atom called atom-to-photoshop that runs ExtendScript/jsx files. There is a good chance that atom-to-photoshop work with ExtendScript for After Effects by adding #target aftereffects in the first line if not I know that the brackets version does, example here https://github.com/JavierAroche/brackets-to-photoshop. The only catch is it only runs on Mac OS. I have a Windows so I couldn’t try it out, so I don’t know if works, but it’s worth trying. I’m still looking for a Windows solution.

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 7, 2017 at 4:05 pm in reply to: Atom text editor for after effects scripting

    I don’t know if it’s possible, but I looked at Atom’s plugins. Out the all the major text editors I would say that Atom has the most plugins (Atom has a lot of plugins). Most of the plugin involving ExtendScript seem to compile it, but not run it. I’ve tried looking at Node.js npm packages which is kind of like a huge plugin database for any text editor, and I didn’t find anything. Just try looking at both Atom’s plugins and npm, even if they don’t have exactly what you want they still have some cool stuff.

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 7, 2017 at 1:38 am in reply to: Atom text editor for after effects scripting

    You can use the $.evalFile() method to use upload an external file. Inside evalFile you are going to add the address of the file on your computer. If you are working in Windows use ‘Copy Path’ in the window explorer to get the file’s address. You can code and save the file in Atom or any text editor and After Effects will see the code and run it. Write your code how you usually would in After Effects and everything should be good.

    Tip: Since JavaScript and Expression are very similar languages save your file as a js file which stand for JavaScript. Atom will give you more options as js rather than a txt file.

    I’d also did a video on it in a little bit more detail…
    https://www.youtube.com/watch?v=NXkKGd-6T5s

    //Example:
    var path = "C:\\Users\\Admin\\Desktop\\Coding After Effects\\Episodes\\Back to Basics\\Text Editor\\Document\\expression.js";
    //Use a double backslashes or a single forward slash because a single backslash will take the text out of the string
    $.evalFile(path);

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Demarc Johnson

    December 5, 2017 at 12:48 am in reply to: How to trigger animation by markers (in and out) ?

    Sorry I was wrong, you can scale if you want to scale the text. It was the spacing between lines that was making sourceRectAtTime() at a little weird. I guess because you spaced more than I ever have was using sourceRectAtTime it caused a problem, but I did a workaround by parenting the shape layer to the text layer and by using a if/else in the position of the shape layer.
    You can use the sourceRectAtTime for both caption and lower thirds. In this AE file add more padding on the x position to give it a lower third look.
    I pretty sure there is a better way to code the sourceRectAtTime problem, but this work great for a quick fix.
    11930_cowvideoismissingconverted.zip

    //Here is that position code other people who are reading this.
    var txt = thisComp.layer("TEXT+MARKERS");
    var twoLine = txt.sourceRectAtTime(time - txt.inPoint).height;
    var slider = thisComp.layer("Padding Control").effect("twoLine")("Slider"); //A slider control to control the Y position when there is two lines
    var x = value[0];
    var y = twoLine > 60 ? value[1] + slider : value[1]; //Here is the if/else statement that allow me move the y position accordingly for the second line
    [x, y]

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 3, 2017 at 3:30 am in reply to: control with markers problem

    This might work, you forgot to add a comparison in the if statement.

    if (comp("MAIN COMP").layer("HOR-TXT-1").marker.numKeys > 0){
    m = comp("MAIN COMP").layer("HOR-TXT-1").marker.nearestKey(time);
    t = m.time;
    s = comp("MAIN COMP").layer("HOR-TXT-1");

    if (m.index % 2 === 0){
    ease(time+s.inPoint,t,t+25*thisComp.frameDuration,0,100)
    }else{
    ease(time+s.inPoint,t,t+25*thisComp.frameDuration,100,0)
    }
    }else{
    value
    }

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 3, 2017 at 2:11 am in reply to: How to trigger animation by markers (in and out) ?

    I was messing around with the file you give and one problem was that text layer was scaled. I don’t know why, but scale makes the sourceRectAtTime go crazy.
    Another problem was some of the code you had copied from the forum was repeated twice.
    I added a null with a slider control to give you better control over the width and the height.
    I added the code that I spoke about earlier in the forum, this way you don’t have add keyframes, but just add/delete markers to change caption.
    (Sorry, I’d forgot to tell you to put that first code in the sourceText property).
    Don’t delete the first marker.

    11926_cowvideoismissingconverted.zip

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 2, 2017 at 12:40 am in reply to: How to trigger animation by markers (in and out) ?

    You can make an lower third for each caption by creating a rectangle shape layer. *****Make sure you pick whip the text layer with the caption for that txt variable in the code.

    //In the shape layer go to content > rectangle path > size and put in...
    var txt = thisComp.layer("printing"); //Change by pick whipping the text layer with the caption
    var x = txt.sourceRectAtTime(time - txt.inPoint).width; //This will make the shape layer the same width as the text
    var y = txt.sourceRectAtTime(time - txt.inPoint).height;
    [x, y]

    //In the shape layer go to content > rectangle path > position and put in...
    content("Rectangle Path 1").size / 2;

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

  • Demarc Johnson

    December 1, 2017 at 5:07 am in reply to: How to trigger animation by markers (in and out) ?

    I’ve forgot, but of course you will keep the out marker comment empty to get rid of the subtitles.

    For Expression Tutorials:
    https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw

Page 1 of 3

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