Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all 2143 articles
Browse latest View live

[free script] conSOLIDator


PseudoEffect organization

$
0
0

I have been developing some crazy specific custom controls in After Effects and I have to build the markup in the PresetEffects.xml every time I get a wonderful upgrade, I love my code because it wipes out the file and replaces it with the new one. I am wondering if there is a way to utilize the XML markup for embedding an external xml file within the same directory into this PresetEffects.xml file rather than having to add ALL this code every time. I know a lot of Third Party developers would love something as simple as adding 1 line of code to that file and then adding their effects.xml file in that directory. It would be clean and great for development.

 

Currently tried nearly all variations of the entity tag that should allow this to embed the external xml, but I think I am missing some step or will need the ADOBE programmers to allow such a feature.

 

First you declare the entity you want to include, in the top portion of the DOCTYPE Effects tag, and then you refer to it by name as an Entity Reference later at the end of the Effects tag.

<?xml version="1.0" encoding="utf-8"?>

     <!DOCTYPE Effects[

 

     <!-- Inline DTD for After Effects effect definitions -->

     <!-- Current used only to define parameters for "pseudo" effects used for -->

     <!-- presets. -->

     <!ENTITY myEffects SYSTEM "myEffects.xml">  <!-- This line of code points to a file that exists in the same directory as the PresetEffects.xml -->

     <!-- Definitions of objects in this file, for validating parsers and editors -->

     <!ELEMENT Effects (Effect)*>

         ~ THIS IS ALL THE ADOBE CODE ~

     ]>

 

     <Effects>

          <Effect matchname="ADBE Color Swirl" name="$$$/AE/Preset/ColorSwirl=Color Swirl">

             <Slider name="$$$/AE/Preset/TransitionCompletion=Transition Completion" DISPLAY_PERCENT="true" default="0" valid_min="0" valid_max="100"/>

             <Color name="$$$/AE/Preset/FinalColor=Final Color" default_red="20" default_green="192" default_blue="50"/>

         </Effect>

         ~ THIS IS ALL THE ADOBE CODE ~

          &myEffects; <!-- at the end of the code add this Entity Reference and it will place your effects here. -->        

     </Effects>

 

The external xml page only needs the correct Effect mark up.

 

     <Effect matchname="Pseudo/McFader" name="$$$/AE/Preset/McFaderSettings=EB2 Darth Fader">

          <Checkbox name="$$$/AE/Preset/EffectSwitch=Effect (On/Off)" default="true"/>

          <Slider name="$$$/AE/Preset/FadePixels=Fade Opacity" default="100" valid_min="0" valid_max="100" slider_min="0" slider_max="100" precision="0" DISPLAY_PERCENT="true"/>

          <Checkbox name="$$$/AE/Preset/FadeIn=Fade In (On/Off)" default="true"/>

          <Slider name="$$$/AE/Preset/FadeDurr=Duration In (Frames)" default="8" valid_min="0" valid_max="100" slider_min="0" slider_max="10" precision="0"/>

          <Checkbox name="$$$/AE/Preset/FadeOut=Fade Out (On/Off)" default="true"/>

        <Slider name="$$$/AE/Preset/FadeDurr=Duration Out (Frames)" default="8" valid_min="0" valid_max="100" slider_min="0" slider_max="10" precision="0"/>

     </Effect>

 

 

This will prevent countless hours and headaches of messing up the Adobe file on updates and development.

 

Please let me know if anyone has figured out this quandary.

A hotkey for "solo this layer"

$
0
0

Hi guys!

You can assign a hotkey for that, by pasting "ToggleSolo" = "(Alt+A)" in your Shortcuts txt. I use it like 100times per day. Ultra timesaver.

And it works perfeclty fine in old AE CC (12.2).

But completely doesnt in everything that is newer.

I searched and asked, but in space, no one can hear you scream...

Anyone?)) Thanks!

After Effects rendering problem in CC 2015 and later

$
0
0

Hi,

 

I have a suite of tools that I help author that I want to update to the new versions of After Effects, but one blocking issue that I am having difficulty debugging is that when I render my images, it no longer renders them. It adds the items to the render queue, processes them through it with no errors, but no images result. So, when my code goes to load the images that it rendered it asserts because the images weren't created. I can give a snippet of my function if it helps:

 

 

 

function renderElement(elementType,element,color)

{

    //remove item from the render queue

    if(app.project.renderQueue.numItems > 0)

    {

        app.project.renderQueue.item(1).remove();

    }

    var activeItem = element;

    // make sure a comp is selected

    if (((activeItem != null) && activeItem instanceof CompItem))

    {

        var my_outputSettings_Path = {

        "Output File Info":{

           "Full Flat Path":mPaylineSetting.mColoredElementsFolderOnDrive + elementType + "_" + color[0].toString() + "_" + color[1].toString() + "_" + color[2].toString() + "_[#].png"

            //"Base Path":path,

            //"Subfolder Path":subFolder,

            //"File Name":fileName

            }

        };

        var my_renderSettings = {

        "Color Depth":"Current Settings",

        "Quality":"Draft",

        "Effects":"Current Settings",

        "Time Span Start":"0.0"

        };

 

 

        var RQitem = app.project.renderQueue.items.add(activeItem);

        // grab the first output module

        var OMitem = RQitem.outputModules[1];

        // apply templates

        RQitem.applyTemplate("PNG_Sequence");

        OMitem.applyTemplate("PNG_Alpha");

        app.project.renderQueue.item(1).setSettings( my_renderSettings );

        app.project.renderQueue.item(1).outputModule(1).setSettings( my_outputSettings_Path );

        try

        {

            app.project.renderQueue.render();

        }

        catch(error)//display error info

        {

            var str =  "Error when rendering a colored element:" + "\n"

            + "Exception: " + error.name + "\n"

            + "File Name: " + error.fileName + "\n"

            + "Line: " + error.line + "\n"

            + "Message: " + error.message + "\n";

            throw str;

        }

    }

}

 

Thanks,

 

- Adam

Changing gridlines with extendscript

$
0
0

I'd like to build a script that automatically adjusts the "Gridline every: ### pixels" preference based on the active comp's resolution. Yes I know about the proportional grid, but I like that the non-proportional grid has subdivisions so I prefer to use that. The issue I'm running into is that if I change the preference's value through extend script, it doesn't update in the comp viewer until I've opened and closed the preferences window. However, if I try to change the proportional grid's division, it updates in the comp viewer instantly. For whatever reason the preferences for the normal grid are in Adobe After Effects 14.0 Prefs-indep-general.txt, while the the preferences for the proportional grid are in Adobe After Effects 14.0 Prefs.txt, so I'm thinking that's probably the root of the problem. Anyone have any thoughts on what's causing this obstacle, and maybe a solution to fix it? Here's the code to change the preferences:

 

// Changes grid to every 64 pixels

app.preferences.savePrefAsString("Main Pref Section v2", "Pref_GRID_PIX_PER_DIV", "64.000000", PREFType.PREF_Type_MACHINE_INDEPENDENT);

 

// Changes proportional grid to 8 increments horizontally

app.preferences.savePrefAsString("Main Pref Section v2", "Pref_ANIMGRID_CELS_HORIZ", "8.000000");

AE Script

$
0
0

I recently updated from After Effects 2017 to 2018 and it broke my AE Script.

     app.executeCommand(app.findMenuCommandId("Convert to Editable Text"));

    now throws an error, but used to work just fine in AE 2017

 

Has anyone found a way to work around this?

Why my Relative Path only work at first load?

$
0
0

Hello Ae Scripting Friends.

 

I'm trying to get all my UI images from a folder inside ScriptUi Folder called "myImagesFolder"
My Scrip is already running inside the ScriptUi Folder.

 

I'm trying this:

var myButton = mainGroup.add("IconButton", undefined, "myImagesFolder/myImageName.png", "AlignLeft");

 

When my UI is loaded for the first time, the script find all paths and build it correctly.

 

But some iconbuttons, need to change the used image.

 

When the iconButton.onClick is activated.

I get a message saying that Path or image does not exist.

 

If the path is correctly located on the first loading, why does not it find the path anymore in the onClick function?

Could someone please help me?

 

Thanks

 

Rubens Nobre

ScriptUI User inputs to an array

$
0
0

Hi everyone,

I'm actually writing a script where I ask the user to enter values (x and y).

These values build a second window with x panels and y rows.

Each row has an edittext and i'm trying to push the values entered into an array.

 

When I click on the OK Button my arrays seems empty. Do you have any advice for me ? Thanks a lot !

 

// Create a container panel for the components
function panel(){
win.pnl = win.add("panel", undefined, "Data"+(j+1));

// Use the panel's add() method to create components
function valuePanel(){
win.pnl.titleSt = win.pnl.add('statictext', [15,15,200,35], "Value" +(i+1)+" :");
data = win.pnl.add('edittext', [15,15,200,35]);
data.onChange = function(){ // changement du texte
data.text = data.text.replace(",", ".");                  
arr[j].push(Number(data.text));
}
}
for (i=0;i<valArray;i++){
valuePanel(i);
};
}

for (j=0;j<val;j++){
if (!(j in arr)) {
//if it doesn't exist, we need another array to fill
arr[j] = [];
}
panel(j);
}

 

  Script.png

 

[Moved by a moderator to the AE Scripting forum from the regular AE forum.]


Script - Create dropdownlist from layer comments not working as intended

$
0
0

Heyo everyone!

 

Im trying to make a list of all the comments ive added to my layers, but i dont want any duplicates.

I want add the items to a dropdownlist.

 

It seems it uses the if(found == false){ before the if(commentLayer[c] == panel.Label.R3.L1.items[k]){ ??

what it does now is create a new items for every comment including the duplicates.

 

This is the code i have now:

 

                   panel.Label.R3.refresh.onClick = function (){

                       alert("Refreshing list!");

                       var comp = app.project.activeItem;

                       var numlayer = comp.numLayers + 1;

                       for (i = 1; i < numlayer; i++){

                           var commentLayer = comp.layer(i).comment.split("|");

                           for (c = 0; c < commentLayer.length; c++) {

                               var found = false;

                               var numList = panel.Label.R3.L1.items;

                               for (k = 0; k < numList.length; k++) {

                                  if(commentLayer[c] == panel.Label.R3.L1.items[k]){

                                       alert("found!")

                                       found = true;

                                   }

                               }

                                if(found == false){

                                    panel.Label.R3.L1.add("item", commentLayer[c]);

                                    panel.Label.R3.L1.selection = 0;

                                    alert(found)

                                }

                            }

                        }

                   }

 

im kinda new to scripting so its possibly not the best way to do this

 

Do you guys know what im doing wrong? i cant figure it out.

 

 

Thanks in advance!

Highlight last created / modified keyframes

$
0
0

Hi everyone. I'm trying to create a script that would help me select my most recently altered key frames. This could probably be done by a psuedo history kind of thing. But I kind of want to avoid that, cause it could be hard on memory, and require a lot of optimization.  Are there any native extendscript methods that may get me close to this? Thank you in advance.

Is it possible to #include a JSXBIN to my Script?

$
0
0

I'm trying to include it, but the functions do not work properly. Is there any specific formatting to include JSXBIN?

tree checkbox gui

$
0
0

Hey guys,

I need a gui element that has the collapsible functionality of a "treeview" object (turning the visibility of children off and moving any nodes following the node you're interacting with up for collapsing, down for expanding), but has a checkbox (as well as a twirl down) next to each node and item.

Is there a built in way to do this? Or do I need to program that functionality manually?

Help to understand expression : toComp(value);

$
0
0

Hi there,

 

rather for help I am seeking understanding what's going on in the following simple case:

 

When I add a Point Control effect to the layer. The position of this point is absolute. I add a simple expression to it:

toComp(value);

 

(It seems, that "toWolrld" behaves just the same.)

 

After this treatment the Point Control seems to be positioned relatively to the layer which is applied on. So when I move the layer, the point moves with it, but the Point can be moved freely as well.

 

Would you kindly help me to understand why this works? I thought, that everyhting unparented is child of World. So why after this expression it seems to be child of the layer space itself?

 

Thank you.

Expression and Scripting Improvements in After Effects CC (October 2017)

AErender app to render specific rqindex items

$
0
0

Trying to get aerender to render different items in the render queue.  For example, if there are 20 items, I'd like for once instance to render 1-5, one to render 6-10, and so forth.  However, Can't seem to get it to work.  This is what I'm doing:

 

/aerender -project /project -rqindex 1-2

 

Error I'm getting is:

 

rqindex 2num 13

aerender ReferenceError: Object is invalid

 

 


Color Labels

$
0
0

What kind of data are label colors being saved as in prefs ?

I know this was discussed in a post but can't find the exact post....

Thanks

Alan.

 

 

"Label Color ID 2 # 1" = FFB60505

          "Label Color ID 2 # 10" = FF8E","9A

          "Label Color ID 2 # 11" = FFC8"~"0C

          "Label Color ID 2 # 12" = FF7F"E*"

Need help in converting this script into a ScriptUI string panel?

$
0
0

Hi there,

 

I'd like to work out the most efficient way of converting this script into a string based Script UI panel.

 

Here's the script itself:

 

http://omino.com/pixelblog/wp-content/uploads/2011/12/om_midi.jsx

 

Trying to get the overall script to be layout out with this structure:

 

AfterEffects-ExtendScript-Extensions/ScriptUI Resource String Reference.jsx at master · VinhSonNguyen/AfterEffects-Exten…

 

Can't figure out where to start, can someone give me a hand in the right direction or if it's easier, help convert it for me?

 

Thanks.

Looking for javascript code for specifying folders (or layers) by name only.

$
0
0

Hello all,

 

I cannot get my head around the code for importing elements ,where the items are placed on the timeline, as well being neatly arranged in an existing folder in the Project. (In this script he places the item in the folder Solids?! Also this is a riddle to me.)

 


Could you help me out please?

 

 

The script will import the animatic and place it on the timeline.
But unfortunately I do not know the code to specify the folder to place the imported item in.

 

var nom=prompt("Specify the Sequence and Scene number :","S000_SC000","LHDK AE");

 

 

//~ var folderAnimaticRefs = HERE I DO NOT KNOW THE CODE UNFORTUNATELY TO SPECIFY THE FOLDER: ("01_ANIMATIC & REFS");

 

 

 

function importAnimatic(){

 

if (confirm("Choose your ANIMATIC file")){

    var animatic = File.openDialog("Select ANIMATIC"); // select file

//~     if(animatic != null) {

        var myImportOptions = new ImportOptions();

        myImportOptions.file = animatic;

        var myAnimatic = app.project.importFile(myImportOptions);

        myAnimatic.parentFolder = folderAnimaticRefs;

 

 

 

 

    for (it=myProject.length; it>=1; it--){

            if(myProject[it].name==nom+"_SCENE"){

                myProject[it].layers.add(myAnimatic)

             }

       

        }   

   

   

    }

}

 

importAnimatic()


The folder structure will be like in the example:

example animatic import.jpg

 

 

P.S.

 

It would be awesome if you guys could teach me how to avoid using the prompt so the script can find automatically the changing S000_SC000 values. ^^

 

 

 

Highly appreciated,

 

Marc

how do I can stopping this timer function?

$
0
0

Hi,

I use this script for change Slider value.

but when I close script and open again the timer is not answer and I have to close and open again.

Is there a code for stopping timer function?

 

Gtlym = new Object();

Gtlym.CALL = new Object();

 

Gtlym.guid = function() {

     var s4 = function() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); };

     return s4() + s4() + s4() + s4()  + s4()  + s4() + s4() + s4();

}

 

Gtlym.setInterval = function(func,millis){

     this.guid = Gtlym.guid();

     Gtlym.CALL["interval_"+this.guid] = func;

     app.scheduleTask('Gtlym.CALL["interval_'+this.guid+'"]();',millis,true);

}

 

 

//Example:

Gtlym.setInterval(function (){timeSlider.value++;

 

  

   if (timeSlider.value>=98)timeSlider.value=1;

    },10);

Make scripts run from an external text editor.

$
0
0

I know that After Effects scripts can be run from the Atom text editor. I have no clue how . I asked on their forum, and they asked me to get more information from the adobe after efffects people. So is it possible to run extendscript scripts from outside the program. What should i search in order to get the right information? I don't even know at what exactly to pay attention... Should i link the text editor to extendscript to run them, or directly to after effects?

Viewing all 2143 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>