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

convert layer position data -> mask vertex position

$
0
0

I have 2 videos (A;B) with corresponding set of markers, I need to distort video A so position of markers would match position of corresponding markers in video B.

Markers are easily trackable, however I can only apply tracked data to layer's anchor point,

while tools I can use for distortion (Reshape , Revision Warp or Morph) operate with masks.

 

I need a way to convert tracked position data to control individual points of one mask.

Anybody know or can write such script?

 

much appreciate any help


Two arrays, values less than 20 from one array delete the same index numbers from second array

$
0
0

Hi guys,

I have two arrays:

var keyTimes =newArray(1,2,3,4,5);
var keyValues =newArray(30,10,5,25,15);

I want to find numbers less then 20 in keyValues and delete the same index numbers from keyTimes array.

So, the keyTimes array should look like this:

keyTimes =(1,4);

Thanks

Create Output Template via script?

$
0
0

Team,

 

I have found a few posts online about the capabilities of creating templates dynamically via script and the consensus is that it isn't possible. Have there been any updates to these capabilities? Here's the basic requirement:

 

Designers need to have some specific settings created inside their compositions before they will be able to render on our cloud rendering platform and be processed properly. Rather than have them create the template themselves and tie to the comps in the render queue properly, I'd like to be able to create the output template dynamically and associate it to the comp in the render queue all through script.

 

I've figured out the render queue piece, and have gotten stuck on many properties that are read-only. Please tell me that I don't have to have my customers create these templates after 4 years still!!??

 

Thanks for all your help!

 

-brenton

Running AE script with noui

$
0
0

Hi

 

I am trying to automate After effects to run a script which suppose to run with `noui` however when I am running the command I can see the after effects in the task manager but the script does not change anything. I looks like the AE is stuck in the background. when I am running the same script through the Extended Toolkit (GUI)  the script run flawlessly.

 

the command "c:\Program Files\Adobe\Adobe After Effects CC 2017\Support Files\AfterFX.exe"  "C:\Users\dell\aonx\Dynamic App Promo\app_promo.aep" -noui  -r "c:\\Users\\dell\\Documents\\Adobe Scripts\\change_text.jsx"

 

What I am doing wrong?

 

Best

 

Lee

Run after effects script without opening after effects?

$
0
0

I have a project as a template. I want to run a script that injects itself with the project and replaces videos and text depending on the contents of my script file. So far so good, but can I run the script without opening after effects GUI? I use this now: afterfx -r c:\script_path\example_script.jsx. Is it considered best practice to have after effects GUI up and running if going to do many script changes on the template? Basically I am looking for the same functionality as aerender with no GUI.

Script to Load output module template

$
0
0

Is there any way to load .aom file with a script?

Or any way to create new output module template with a script. There is saveAsTemplate() command, but how to configure a template?

ThisAnimator expression ?

$
0
0

Hi!

I'm searching a way to use in an expression the value of an animator name in text animation.

 

Exemple :

I would have a text animation wich would be name "100".

I am searching a way to use that name value in an expression so that I would only have to change the name of the animator and won't have to go manually inside the expression.

Some kind of value trigger

 

text.animator("100").name would work but changing the name won't change the "100" in the expression..

I know the expression thisComp or thisLayer exist. Though thisAnimator doesn't seems to..

 

Is there any way to do it?

 

Thanks!

AE using socket to import picture from URL - Need Your Help

$
0
0

I have a project that works with local network using the path name. I want to update the project to replace all placeholders with a picture located at a URL address instead of the local network. I have no experience with socket coding and can't seem to find the right snippets of code on the internet to get me through this point of using URL as a file location.

 

I tried this code (using a picture at this URL as an example);

 

webConnect= new Socket;

if(webConnect.open("http://distilleryimage3.s3.amazonaws.com")) {

         webConnect.write('GET /2940b7e0236511e2af9022000a1f9a23_7.jpg HTTP/1.0nn');

          response=  webConnect.read();

          webConnect.close();

          alert('complete');

} else {

         alert('fail');

          }

 

Any help will be appreciated. I need the results of the socket connection to be a object I can use in the statement

 

curItem.replace(new File( <picture path> );

 

Thanks again.


Split string by white space and by "|"

$
0
0

Hi,

I think this is very easy but I can't figure it out.

var str = "How are you doing today?";

var res = str.split(" ");

And the result would be:

How,are,you,doing,today?

When user add character "|" between two words like this"

var str = "How are |you doing| today?";

The result shoul be:

How,are,you doing,today?

 

 

 

C:\Users\UserName Folder

$
0
0

Hi, Hello guys, How can I read (file or folder) from "C:\Users\UserName" Folder? (The problem is that every computer changes the user name)

Access the order in which the keyframes has been selected

$
0
0

Hi guys,

I'd like to know if it's possible to access the order in which a bunch of keyframes has been selected.

Can't find any information about that. I'm a beginner.

 

Thank you

Importing files that don't already exist in the project.

$
0
0

Hi,

I'm currently trying to write a script that will import any files from a given location that can't already be found in the After Effects project. I'm very new to scripting so apologies any incorrect terminology or poor etiquette. This kind of does the job but I think there must be simpler, more streamlined and more correct ways of doing.

 

I've been struggling to deal with undefined elements and .DS_Store (mac) files so any help here would be much appreciated.

 

This is what I have so far ...

var numItems = app.project.numItems;

 

var targetFolder = Folder("~/Desktop/TEST/"); // folder path

var files = targetFolder.getFiles();

var filesNum = files.length;

 

var importArray = [];

var newImportArray = [];

var uniqueImportArray = [];

 

for(var i = 1; i <= numItems; i++){

    importArray.push(app.project.item(i).name);

    }

   

    for(var s = 0; s < filesNum; s++){

        importArray.push(files[s].name);

                }

 

Array.prototype.unique = function(){ // found on this forum

    var r = new Array();

    o:for(var i = 0, n = this.length; i < n; i++){

            for(var x = 0, y = r.length; x<y; x++){

                if(r[x]==this[i]) continue o;}

            r[r.length] = this[i];}

        return r;

                }

 

newImportArray = importArray.unique();

 

for(var i = numItems; i <= newImportArray.length; i++){

    uniqueImportArray.push(newImportArray[i]);

    }

 

for(var i = 1; i <= uniqueImportArray.length; i++){

var fileArrayString = uniqueImportArray[i].toString()

//alert(fileArrayString);

var fileSplit = fileArrayString.split(".");

//alert(fileSplit[1]);

if(fileSplit[1] == ("jpg")){

    app.project.importFile(new ImportOptions(File("~/Desktop/TEST/" + uniqueImportArray[i])));

                            }

                        }

                               

for(var i = 1; i <= uniqueImportArray.length; i++){

var fileArrayString = uniqueImportArray[i].toString()

//alert(fileArrayString);

var fileSplit = fileArrayString.split(".");

//alert(fileSplit[1]);

if(fileSplit[1] == ("mov")){

    app.project.importFile(new ImportOptions(File("~/Desktop/TEST/" + uniqueImportArray[i])));

    }

}

Negative Values for Cropping in output module doesnt work

$
0
0

Hi

 

I'm trying to add negative values to the cropping in the output module, but it doesnt works:

 

var crop_data = {
"Crop":true,
"Crop Bottom":0,
"Crop Left":-200,
"Crop Right":-200,
"Crop Top":0
};
app.project.renderQueue.item(1).outputModule(3).setSettings( crop_data );

 

ToolScript gives me an error, that this Value doesnt work. But if i type does values manually into the crop Settings it works. Any Idea what im doing wrong?

 

Thanks

Peter

Create a txt file in Extendscript

$
0
0

Hey!

im trying to create a script that creates a txt file but i can't do that...

 

that is the function code:

 

var scriptFolderPath = File($.fileName).path; // the URI of the folder that contains the script file  
var TimerFolderPath = scriptFolderPath + encodeURI("/ProjectTimers_sources"); // the URI of the folder for your script resources  

StartButton.onClick = function(){ 


var JFile = new File(TimerFolderPath + encodeURI("/File.txt"));
var content="That is a text file";
File.write(content);


alert("File created!");
}

and it doesn't creates any file...

How to Move UI button or any element in x and y axis specifically after creation?

$
0
0

//Below script generates Window,Panel with button

//I would like to move button/UI element in x and y axis to desired location

//Could someone please let me know to achieve it?

 

 

 

function myScript(thisObj){

    function myScript_buildUI(thisObj){

       

        var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "tools",undefined ,{resizeable:true});

    

        

          var resAbout="panel{orientation:'row',\

                                          t1:Button{},\

                                           \

                                          \

                                          }";     

                                         

                myPanel.grp=myPanel.add(resAbout);

 

    myPanel.preferredSize=[500,200];

   myPanel.grp.preferredSize=[500,200];

           myPanel.grp.margins=2;

          

 

  

return myPanel;

 

 

}

 

 

var myScriptPal = myScript_buildUI(thisObj);

 

 

    if((myScriptPal != null) && (myScriptPal instanceof Window)) {

        myScriptPal.center();

        myScriptPal.show();

    }

 

 

}

 

 

      myScript(this);


How to shy composition?

$
0
0

Hi,

I've activate shy for some layer, but I can't activate shy for the composition.

Why this is not working:

app.project.activeItem.shy = true;

 

For example, motion blur is working:

app.project.activeItem.motionBlur = true;

Thanks

Edit Property Name in Essential Graphics Panel

$
0
0

Hi,

I added my properties in Essential Graphics Panel with script,

But not change property name in Essential Graphics Panel with Scripting!

How to change the property name in Essential Graphics Panel with script?Untitled.png

Script for Applying Animation Preset to Layer

$
0
0

Hello,

 

I've been trying to make a simple script in AE CC 2018 to create a null object and rename it, then apply an already-created animation preset to it.

 

The first half works:

 

var myComp = app.project.activeItem;
var myNull = myComp.layers.addNull(myComp.duration);
myNull.name = "Wipe Duration Control";

 

However I can't for the life of me figure out how to set up the second half. I tried the following in a separate script as to not mess up the first half:

 

var myNull2 = app.project.activeItem
myNull2.applyPreset(File("~/Users/Noah/Documents/Adobe/After Effects CC 2018/User Presets/Automated Wipes/Wipe Duration Control.ffx"));

 

but I just get syntax errors.

 

I've also tried this way of doing things:

 

var myNull2 = app.project.activeItem
var presetPath = “Macintosh HD/Users/Noah/Documents/Adobe/After Effects CC 2018/User Presets/Automated Wipes/Wipe Duration Control.ffx”;
Var myPreset = File(presetPath);
myNull2.applyPreset(myPreset);

But still no luck. Does anyone see what I'm doing wrong? This seems like the most rudimentary of scripting functions, so it's frustrating to miss something that must be under my nose.

 

Thanks!

How to set up a script with 4 controllers to control several layers?

$
0
0

Hi, Iam kinda of a newbie when it comes to expressions and scripts so please bear with me.

 

I have a bunch of images (15 images or more) in my comp and I want to control them all from a script UI.

I was thinking of having something like this in my UI window:

Layer control (to choose with image will be affected)

Point controller (for position)

Angle (for rotation)

Slider (for scale)

 

I have to make this as tidy as possible because it will be mostly used by people with 0% After effects Knowledge.

Is it possible? To have just does four controller to control al the images instead of having position, rotation and scale for everyone.

Could someone help me please with this? Thanks in advance.

restart a script in a new project

$
0
0

Hey!

I Have this code to get the project name(see below)

and it is working, but it always shows the name of the project it opened first.

for example lets say that we have "ABC" and "ZER" (As project names)

i opened the dockable script in project ABC and requested to show the project name - it will say ABC.

but then i will open another project, and i will request to show the project name - it will say ABC and not ZER.

 

thats the code:

var p=app.project;
var projTLayersFound=[];
var projTextName = "this project";
//get project name:
var projName = p.file.name.replace(/%20/g, "");
var didNotFindOne = true;
Viewing all 2143 articles
Browse latest View live


Latest Images

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