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

compPointToSource method doesn't work with 3D layers.

$
0
0

Everytime I use compPointToSource method to a 3D layer via scripting, After Effects crahes! And ExtendScript gives me the notice:

After Effects error: crash occurred while invoking plug-in "Scripting".

But sourcePointToComp method works fine.

Is this a bug of after effects? I have both cc 2015.2 and cc 2017 on my machine, they have the same issue.

By the way, I'm on Window 10.

Help me!


AfterEffects.exe always hangs up when script from command line

$
0
0

After Effects 14.1.0.57 on Windows 7

(same problem with AE 14.0)

 

 

Hi all,

 

This is a fresh AE install on a new Windows 7 (uptodate, 8GB Ram). The same problem occurs on 3 other PC.

 

When I run a script from the command line, After Effects hangs up with the following messages :

Image3.jpg

 

The problem is the same, wathever the script.

Exemple of script :

     AfterFX.exe -r "C:\myproject\script-render.jsx"

 

An example of the jsx file :

   

{

    var myProject = File("C:\myproject\modele_multi_1.aep");

    app.open(myProject);

 

    if (!app.project) {

        alert("bam");

    }

 

    if (app.project.renderQueue.canQueueInAME == true) {

        app.project.renderQueue.queueInAME(false);

    } else {

        alert("There are no queued item in the Render Queue.");

    }

    app.quit();

}

 

If I open the script from within After Effects via the "File-Script-Run Script File" command, it works great.

In File Preferences, "Allow script to Write File" is checked as "Enable Javascript Debugger".

 

Running from command line was working fine with the After Effect CS6 older version.

 

Any idea ?

 

Regards,

 

Eric

Exsport Bs Binary only part of code

$
0
0

Hi guys,

 

I need to Encrypt only part of my code,

Like "Exsport Bs Binary" but only for part of the code,

how can I do it?

 

thanks a lot

Getting a box text anchor point after resizing it

$
0
0

Maybe this has been addressed but I can't find info about it. Here's the description of my problem:

 

1.- I create a box text and I can calculate the text's anchor point because is right in the box center.

2.- I change the box width and/or height. The anchor point remains in the original place.

3.- There's no way I can get the box anchor point coordinates, neither absolute nor relatives to the text box.

 

If After Effects can remember where the original anchor point was (because it doesn't change after resizing the text box), this information must be stored somewhere. But where?

Can't change Text Properties from scripting

$
0
0

Hi Everyone,

 

I made a script to change all the fonts in a project, but since some days, nothing works anymore.

Is there a nex feature in AE 17 ?

 

Here is a simplified code with the fontSize;

 

var myComp = app.project.activeItem;

var myLayer = myComp.selectedLayers;

 

myText = myLayer[0].property("Source Text").value;

alert(myText.fontSize);

 

myText.fontSize = 60;

 

The alert returns the actual font Size, but nothing changes. It's the same with all other properties font, tracking, justification...

Exporting comp and layer coordinates to Touch Designer

$
0
0

Hi All,

 

Rank beginner, trying to get a handle on exporting to a spreadsheet.

From an active comp, where every layer is an imported asset;

I need to export layer name, position, scale, and rotation in columns.

No animation, info on frame 1 is all I need.

Any help much appreciated.

 

Best,

Tony

Scrolling text / Flickering / Expression

$
0
0

Hello everyone,

 

i found a formula on the web for avoiding at max the flickering effect on scrolling title for non-interlaleced video

 

rate = 2; //value in px/sec.

value - [0,rate*timeToFrames(time)]

 

its working pretty good for vertical movement but i would like to use it for an horizontal movement ( Legals on bottom of frame that have to roll from right to left on some commercials )

 

i tryed to use this formula but it's working only on the Y axis.

can someone help me on this?

have you a better solution / formula for horizontal movement without flickering?

 

sorry for my english, iam french

thx in advance

Creating portable psuedo-effects for AfterEffects

$
0
0

Hi There,

 

I have some scripts that rely on a bunch of different expressions controls.  I wanted to know if there was a more organized way of creating a preset that included all of the expressions and their default values.  I found the video tutorial over at batchframe where the Jesse Toula explains the method of modifying an .xml to create pseudo effects.  Is there a way to create pseudo effects without having to touch the .xml file?  I'd like for the preset effect to be as portable as possible.  The batchframe tutorial makes it clear that if the .xml file does not contain a declaration of the effect, and the preset is applied, it will prefix the preset with "Missing".  Is there any way to avoid this?

 

Thanks!


How to open an extension from ExtendScript?

$
0
0

I need to open an extension via extendscript so I can open the panel via command line.

 

The closest I've gotten is:

app.executeCommand(app.findMenuCommandId("MyExtension"));

 

However this command acts as a toggle; if the panel is already open, the command will close it.

 

The only documented way I've found is:

csInterface.requestOpenExtension('extensionId')

However, this only works from another panel, which doesn't help.

Easy way to crash After Effects CC 2017 : run a script from command line

$
0
0

Hello,

 

With After Effect 14.1.0.57 on Windows 10, when we run the next script from a .bat file, AfterFx.exe crash each time :

AfterFX.exe -r "E:\MyWork\JobToDo.jsx"

 

Whatever the parameter after the "-r" you can crash AfterEffects.exe :

  AfterFX.exe -r E:\MyWork\GoodFile.jsx  : CRASH

  AfterFX.exe -r E:\MyWork\FileWithFakeFileNameThatDoesNotExist.jsx : CRASH

  AfterFX.exe -r    (without any argument) : CRASH

If AfterFX.exe is already opened or closed, it is the same problem.

 

Here are the error dialog boxes :

hjcliiekhppbkiih.gif

Then

jkeffnpodcbfkegk.gif

 

We were working this way with After Effects CS6 and it was perfect.

We need to run AE this way because it's in a completly automated process. No human interaction.

 

 

Any idea ?

 

 

Kind Regards,

Pierre Demarle

trigger watch folder render with RCF file

$
0
0

Hi,

I'm trying to trigger a render in a watch folder without using the "collect" dialog box. I've written my own code for collecting the project to the watch folder. The last thing I need to trigger the render are the two .txt files that doing it manually usually spits out. fileName_RCF.txt and fileNameReport.txt.

 

The text inside looks like what I've added below. Short of recreating all this information manually in code, is there any way to output this information with Extendscript?

 

fileName_RCF.txt

After Effects 13.2v1 Render Control File

max_machines=5

num_machines=0

init=0

html_init=0

html_name=""

 

fileNameReport.txt

Report created:

  2/22/2017 3:12:37 PM

 

 

Project name: fileName.aep

 

 

Source files collected to:

  \\networkComputer\Share\watchFolder\fileName folder

 

 

Source files collected: All

 

 

Collected comps: 

  MASTER

  HD_EP06_animatic

  SC01

  Copter Blade

  SC02

  SC03

  SC04

  SC05

  CopterGaugeDials

  SC03_KD

  SC03_CM

  SC01_clean copter

 

Number of collected files:  20

 

 

Size of collected files:  149 MB

 

 

Collected source files:

  \\Yellow\current\AIRI\ANIMATION\SCENES\opening\Layouts\AIRI_Final_Scene_Layout-01.jpg

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Audio\SC02.wav

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Audio\SC03.wav

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Audio\SC04.wav

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Audio\SC05.wav

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\HD_EP06_animatic_v2.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC02_cap.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC02_kid.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC02_REF.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC03_CM.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC03_KD.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC03_REF.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC04_export.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC04_REF.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC05_CM.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC05_KD.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Footage\SC05_REF.swf

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Raster\SC_01_BG_consolidated.psd

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\Raster\SC_02_BG_consolidated.psd

  F:\!!!CURRENT\scripting\ae\Export Scenes\ACTEST_EP06_MASTER_v01 folder\(Footage)\SC_04_BG_consolidated Layers\SC_04_BG_consolidated.psd

 

Rendering plug-ins:

  Classic 3D

script to access animated mask vertices XY position data

$
0
0

hello,

 

I believe there is a way to extract XY positions of vertices on animated maskShape. I would love to use this extracted data to drive XY positions on several Null objects in another layers. So every Null object is related to different vertex on maskShape. I found an older Rotoscopy script that work in sort of opposite way I need. Is there anything like that out there? Is it even possible to create?


Thanks for your help.
Jr.

recent files or projects menu

$
0
0

Hey there,

Just wondering does anybody work with scripting the recent files in the prefs ?

I just tried to manually extend it in the txt file to be 20 files, doesn't seem to work...   do people read the prefs file for recent files

when scripting AE?

 

Thanks

Alan.

DPX sequence to MOV script with Audio & TC - Batch not working

$
0
0

Can please someone here help me out on this topic, i am new to AFX/java scripting and i already spent around 15h on that

subject but it simply does not work-

 

the background:

we are shooting DPX sequences with a Convergent Design ODYSSEY SSD recorder, thats the only way for it to get perfect

image quality inside the box, i want 4:4:4 and RGB together with minimal compression (and the box is not yet able to do ProRes4444).

For editing/finishing purpose it is way easier to work with .MOV files instead of image sequences (as we are producing around 100.000 DPX files a day,

compared to around 80 .MOV files)

 

the task:

create a script that imports a DPX sequence from a folder,

imports the corresponding .WAV file with same starting name too,

creates a new timeline in AFX "from DPX sequence selection" (to keep the timcode!)

renders that timeline with a given output module to another given folder

deletes all items and projects afterwards

 

Somehow, I managed to do that, it works most of the time but function "app.executeCommand(app.findMenuCommandId("New Comp from Selection"

seems to be buggy somehow, does not work everytime or just after you did that at least once manually inside AFX ?

 

the bonus task (thats where i failed)

create a folder selection dialog that reads all subfolders (with the corresponding DPX sequences inside) to an array

use that array to get the sequence file names and count the number of Sub-directories

do the above (Seq conversion from "the task") to ALL THOSE SUBDIRECTORIES (using the names from the array)

 

this cant be that complex ... right ???

i tried to implement it but somehow i always get the error "/e/ODYSSEY/S020_AK0787/S020_AK0787_0000000.dpx is not a File or Folder"

(as this is the image sequence that should be imported - there must be some wrong interpretation between the file name with whole filepath and

the import function ?)

 

Any help is hugely appreciated, i am also willing to donate for help/a working script

(as i cannot afford to enter around 1.000 folders by myself)


i can also provide such a Odyssey file structure for testing/help purposes via wetransfer

thanks

 

 

Script below:

_______________________________________________________

 

var SourceFolder = Folder.selectDialog("Choose SOURCE folder: ");

var SourcePath = decodeURI(SourceFolder.toString()); 

var DestFolder = Folder.selectDialog("Choose DESTINATION folder: ");   

var DestPath = decodeURI(DestFolder.toString()); 

 

var scriptName = "DPX Sequence TO MOV DNxHD with Audio + TC";

var intendedFootageFPS = 25;

var fileToImport, fileToImport2;sidecarFile, sidecarContents, importOpts, footageItem, filePath, fileBaseName, audioFile, audioFootageItem;

var FolderName, SourcePath;

 

var scriptName = "Change Render Locations";

 

function checkForFiles(folderItem, tabString) {

    var theFiles = folderItem.getFiles();

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

        //resultArray.push(tabString + theFiles[c].name + "\r");

        resultArray.push(tabString + theFiles[c].name);

        //if (theFiles[c] instanceof Folder)

        {

           // checkForFiles(theFiles[c], tabString + "\t");

        }

    }

}

 

function AFXConvert(FolderName) {  

   

     app.newProject();

//     fileToImport = File.openDialog("Select file from the DPX sequence", "*.dpx", false);

//    if (!fileToImport || !fileToImport.exists) {

//    }

    app.beginUndoGroup(scriptName);  

     app.project.showWindow = true;

    

     fileToImport2 = (SourcePath + "/"+ e + "/" + e + "_0000000.dpx");

     alert("Folder Import Name " + fileToImport2);

         

     importOpts = new ImportOptions(fileToImport2);

    importOpts.sequence = true;    // import as sequence

    importOpts.forceAlphabetical = true;    // force alphabetical order (to work around 3709647)

  

    

    app.project.importFile(importOpts);

   

     app.executeCommand(app.findMenuCommandId("New Comp from Selection"));

     //app.executeCommand(app.findMenuCommandId("New Comp from Selection")); //sometimes it works better with 2  or 3x ???

     //app.executeCommand(app.findMenuCommandId("New Comp from Selection"));

 

    footageItem.name = decodeURI(fileToImport2.name).replace(/\.\d+\.png/, "");    // remove the numeric part for the footage item name

    footageItem.mainSource.conformFrameRate = 25;

    // if matching audio recording (WAV file), import that

   

    filePath = footageItem.file.path;

    fileBaseName = (footageItem.file.name).replace("_0000000.dpx","");

    audioFile = new File(filePath + "/" + fileBaseName + ".WAV");

    audioFootageItem = app.project.importFile(new ImportOptions(audioFile));

    comp = app.project.item(1).layers.add(audioFootageItem);

    audioFootageItem.selected = true;

    

 

    comp.selected = true;        

    comp = app.project.item(1);

    comp.openInViewer();

    app.project.item(1).layer(2).moveToBeginning();

   

    app.endUndoGroup();

   

    app.project.renderQueue.items.add(comp);

    app.project.renderQueue.item(1);

    app.project.renderQueue.item(1).outputModule(1).file = new File("D:/" + e + ".MOV");

    //alert("d:/" + fileBaseName + ".MOV");

    app.project.renderQueue.item(1).outputModule(1).applyTemplate("QUICKTIME DNxHD 365 RGB444 Audio");       

    app.project.renderQueue.item(1).outputModule(1).postRenderAction.NONE;  

    app.project.renderQueue.render(1);

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

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

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

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

   

}

 

 

//---------------------------------------------------------------------------------------- ------------------------------------

//PROGRAM START

//---------------------------------------------------------------------------------------- ------------------------------------

 

app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);

 

if(SourceFolder != null){

    var resultArray = new Array(1);   //clear old array to 1 entry    

    var resultArray = new Array();   

    checkForFiles(SourceFolder, "");

    $.writeln(resultArray.toString().replace("",""));

    //alert(resultArray);

    var FolderCount = resultArray.length; 

    alert("Number of folders: " + FolderCount);   

    }

 

    if(DestFolder != null){     //Makes sure root folder choice was not canceled 

      var d1 = resultArray.toString();          

    } 

 

 

 

//----ENCODING LOOP  ----------------------------------------------------------

 

var e = resultArray.shift();

 

for(var k=0; k<FolderCount; k++){         

              alert("Array/Folder Counter: " + k +":" + e);

              //resultArray.toString(resultArray);            

              fObj = Folder(DestPath + "/"+ e);

              fObj.create();             

              AFXConvert(e);

              var e = resultArray.shift();

             

     }           

試用期間ではエフェクトは使用できないのですか

$
0
0

エフェクト(時間)グレイアウトして使用できない。


Is there a way to call Collect Files with Extendscript?

$
0
0

I'd like to be able to create a script that collects files to a watch folder on the network and triggers our render machines that are watching said folder to start rendering, all with the click of a single button. Unfortunately, I haven't been able to find a way to call File>Dependencies>Collect Files with Extendscript. Is there away to do that? So far I've only found a script that manually copies all the files itself rather than using AE's Collect Files feature, but doing this fails to trigger the render from the computers watching the folder.

Thanks.

Edittext: scrollable, numeric only with limited values

$
0
0

I'm tyring to achieve what is commonly used in multiple places across After Affects - edittext fields with numeric-only values which you can change by either typing the value in with keyboard or by scrolling with mouse left or right. When it comes to modyfing the values, I want them limited - let's say to integer only in range of 1-100. Something like this:

6b4uNWD.png

 

I did some research but didn't find any references of others doing it. On the other hand, this is so common across After Effects that I don't see why this wouldn't be made available easily.

 

If this is possible - how can I do it? If not - why so and what are my options?

Live / Scrollable Value Fields in Script UI

$
0
0

Is there a way to use a live scrollable field for values in your script UI the same way AE has for everything else (blue values in image below), or can we only use basic edit text fields.

Screen Shot 2017-02-28 at 8.52.18 AM.png instead of Screen Shot 2017-02-28 at 8.53.27 AM.png

Any advice or ideas are appreciated.

 

Thanks,

 

Justin

Top/Left Value of Point Text Relative to Composition?

$
0
0

So since the width and height of a point text layer is

 

--always the size of the composition

--calculateTransformFromPoints can only set and not read a set of values

-- a point text layer's sourceRectatTime top and left values (as well as baselineLoc values)  are relative, as far as I can tell, to its... anchor point? And

-- I can't rely on its anchor point since a) end users move the anchor point and b) we have other functions that periodically center the anchor point of every layer,

 

I was wondering if there were some other way to calculate the top and left values of a point text layer relative to the composition?

 

Do I have to draw a mask that is the full size of the layer and then derive the values from its vertices?

Disable panel while no ActiveItem is selected

$
0
0

I need some code that checks if an active item is selected so that the panel is only enabled while a comp is selected. I tried a while loop, but it keeps crashing After Effects. The code below is wrong I know, but I need something similar:

 

if(app.project.activeItem == null)

{

panel.disable();

}

else

{

panel.enable();

}

 

Any ideas/thoughts are appreciated.

 

Thanks,

 

Justin

Viewing all 2143 articles
Browse latest View live


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