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

Issues opening ExtendScript ToolKit CC on Mac OS

$
0
0

I am having issues opening ExtendScript Toolkit CC on Mac OS. It was working one day, and then two days later stopped working. I'm using it with After Effects as well. I tried opening it manually, and it still didn't work. I tried to uninstall and re-install it, and nothing worked. I can't open any files that are involved with the ESTK. I ran my computer in safe mode, but there were still issues with it. I changed the permissions with it. No one else in my class is having this issue. Does anyone have any solutions?


After Effects to DaVinci Resolve Automation

$
0
0

I'd like to share a little proof of concept on automating import of After Effects renders into DaVinci Resolve Studio. I kept the basic building blocks very simple, but they could be expanded quite a bit to offer a high degree of automation. The project files are on GitHub.

 

After the render is finished, the After Effects script calls a tool I wrote called Projector in non-GUI mode. It creates a new Resolve project and imports the rendered files into a bin. The location of the rendered files and the bin name are defined in the .json template file. The template file is premade in my example, but it could also be created on the fly by the After Effects script.

 

The whole thing can be achieved without Projector by using  the DaVinci Resolve Studio scripting API. But the API is not well documented and it's easier to use Projector as a thin layer on top of the API.

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*"

After Effects MGJSON Details

$
0
0

Hi,

I am currently looking for ways to animate visualizations that change over time frame e.g. A sales bar graph that shows changes over the years by using just one JSON file. Also it would be really helpful to get hands on with some dummy MGJSON stuff and guides.

How does a MGJSON look like?

$
0
0

I saw that the 2018 edition came with a new feature for importing data from JSON and MGJSON. From my understanding, a MGJSON file has a timeline and is easier to integrate to AE. But I can't find any documentation, references to or examples of this filetype anywhere.

 

If somebody have any documentation or know how the syntax of such a document is and if it even is simple enough to edit through a text editor, let me know!
I'd love to be able to try this feature out.

How to find the text animator with the earliest keyframe?

$
0
0

So here's my code so far:

var animRot=lays[0].text.animator(i)("Properties").rotation.numKeys;
var animRotKey=lays[0].text.animator(i)("Properties").rotation;
var rotTimeCheck = [];
var earlyRot = 0;    if (animRot>0)            {             for(var x=1; x<animRot; x++)             {                        if (x==1){rotTimeCheck[x] = animRotKey.keyTime(x); earlyRot=rotTimeCheck[x];}                        else                        {                                rotTimeCheck[x]=animRotKey.keyTime(x);                                if (rotTimeCheck[x-1]<rotTimeCheck[x])                                {earlyRot = rotTimeCheck[x-1];}                             else                             {earlyRot = rotTimeCheck[x];}                         }                        }                  }              var earlyKey = [];              var earliestKey = 0;              var earliestAnim = undefined;              earlyKey[i] = Math.max(earlyOpa,earlyPos,earlySca,earlyRot);                            if (i==1)              {earliestAnim = lays[0].text.animator(i);}              else              {                  if (earlyKey[i]<earlyKey[i-1])                  {earliestAnim = lays[0].text.animator(i);}               }       
earliestAnim.name = "dontdeleteplz";

 

So to spare you a huge chunk of code imagine that there is three more pieces (for opacity, position, and scale,)

and this code always returns earliestAnim as the first animator on my layer. I'm pretty sure I just have some sort of syntax error but I can't seem to figure out what it is.

Async Communication between CEP Panel and JSX

$
0
0

Hi,

 

I'm having trouble doing some async action using a CEP panel in AE. Let me explain what I would like to do :

 

     From a CEP Panel after clicking a button I'm using "csInterface.evalScript" to evaluate a function inside AE. This function may take a while to end (few second to a few minutes), and I would like to keep track of the progress of the function inside the CEP panel. For example having a progress bar in my CEP panel that reflect the number of data loaded by my function in the jsx. To do that I tried to send event from the JSX to the panel to update the progress bar, but has it has been pointed out by Davide Barranca in this post : https://www.davidebarranca.com/2014/07/html-panels-tips-11-externalobject-cep-events/ , the event fired by the jsx are called in the panel only after the jsx script has finished to get executed. I also try to execute a function each XXX ms in the CEP panel that would execute a csInterface.evalScript that return info on the progress but without success neither.

 

Maybe what i'm trying to do is not possible, but if anyone came up with an idea to have a "continuous talk" between a CEP panel and jsx script I would be very grateful.

I'm using AE 2018 version 15.0

 

Thanks for help.

Generating AE scripts from keyframes?

$
0
0

I've only recently started working with AE scripts and was wondering if there is a way to capture old text animations and somehow save or export them as scripts?


EditText Listbox subitem

$
0
0

I'm trying to add a way to update a subitem in a listbox using editText

 

I have two columns, Column one is to reference my layer, Column two is to reference a value.

 

My array will always sequentially go in order, but my value will always change. So I want to include to the expression below. That if I fill out

var input = win.add ("edittext");
input.active = true;

then hit the add item button, it will at the item plus the sub item we have given a value in editText

 

it will add it to column two if I hit add item.

 

Then say I got the number wrong and I want to change that value. If I highlight the row. Refill out

var input = win.add ("edittext");
input.active = true;
then hit the insert button.

 

It will update it.

 

I've seen scripts that just us insert via editText and scripts that use just arrays. I haven't found an example that allows the two, but so far i have this that i've patched with other peoples code. I tried addingsubItems[0].text in relevant areas, but it just crashed.

 

var testArr = [];

startGUI();
function startGUI() {

// Main Window
var win = new Window( "palette", "Test Listbox", undefined, { resizeable:true } );
win.orientation = "column";
win.alignChildren = ["fill", "fill"];

// Listbox Group
var grpListbox = win.add('group');
grpListbox.alignChildren = ['fill', 'fill'];

var myListbox = addListBox (grpListbox, testArr);


// add ListBox
function addListBox(container, testArr) {
var listbox = container.add("listbox", undefined, testArr,
{
numberOfColumns: 2,
showHeaders: true,
columnTitles: ['Bar', 'Value']
});

return listbox;
}

var input = win.add ("edittext");
input.active = true;
var b = win.add ("button", undefined, "Insert", {name: "ok"});

// BTN: Add Items To Array
var addItem = win.add("button", undefined, "Add Item");
addItem.onClick = function() {
testArr.push ('Bar' + " " + (testArr.length + 1));
grpListbox.remove(grpListbox.children[0]);
myListbox = addListBox (grpListbox, testArr);
win.layout.layout(true);
//updateListboxArray(myListbox);
//$.writeln (testArr.length + " " + myListbox.items.length);
}

// BTN: Clear Listbox
var removeAllItems = win.add("button", undefined, "Clear Listbox");
removeAllItems.onClick = function() {
// Clear the array
testArr = [];
updateListboxArray(myListbox);
}

// Update listbox items
function updateListboxArray(listbox) {

// Clear listbox first
listbox.removeAll();

// Create new listbox items from array
var i = 0;
while (listbox.items.length < testArr.length) { listbox.add ("item", testArr[i]); i++;}
}

// Quit BTN
win.quitBtn = win.add("button", undefined, "Close");
win.quitBtn.onClick = function() {
win.close();
}

// Window Settings
win.onResizing = function () { this.layout.resize(); };
win.onShow = function () { win.layout.resize(); };
win.center();
win.show();
}

I know in theory that it works, as I tried changing a paragraph to this and this works to add editText, I just can't seem to combine the two with a subitem.

    // BTN: Add Items To Array  

    var addItem = win.add("button", undefined, "Add Item");

    var input = win.add("editText", undefined)

    addItem.onClick = function() {  

        testArr.push (input.text);

        grpListbox.remove(grpListbox.children[0]);

        myListbox = addListBox (grpListbox, testArr);

        win.layout.layout(true);

        //updateListboxArray(myListbox);  

        //$.writeln (testArr.length + "  " + myListbox.items.length);  

    } 

 

run powershell commands using system.callSystem()

$
0
0

Has anyone been able to invoke powershell commands using system.callSystem()?

 

Here's what I've tried

var response = system.callSystem("powershell.exe /command \"& { gci }\"");
alert(response);

if I try the command from cmd or the windows-r run command thingy I get a directory listing—as expected, but from extendscript I get nothing. I've tried all sorts of variations. Or is cmd the only shell that can be run from system.callSystem()?

Slider UI Element

$
0
0

Hi, my name is Bram and I'm curious if it's possible to create a slider UI element in script UI in ExtendScript.

 

Thx for helping in advance.

Retina @2x.png icons for script UI

$
0
0

Hi, does anyone know where I can find any documentation on setting up retina images for Script UIs in After Effects?

 

From digging around in the After Effects install directories I can see lots of icons using the @2x.png naming convention. So I tried creating my image at 2x res and named it accordingly but if I try this:

 

myButton: IconButton {text:'Import',properties: { style : 'toolbutton' },image:'myImage@2x.png'},\

 

I just get an image that's twice the size it should be. i.e it's not respecting the display.

 

Is there something that needs to be included in the button properties?

 

Thanks,
Chris

How can I extend the end time of synthesis?

$
0
0

How can I extend the end time of synthesis?

in javacsript?

Using JSON to change color.

$
0
0

I am attempting to use a JSON script to change the color of a solid. I have the solid hooked up to a color controller that uses the "Color Control" effect.

I got a text layer to hook up to my JSON using this expression:

 

eval("var practiceText=" + footage("bogus.json").sourceText);

practiceText[0].PracticeText;

 

I am trying to use a similar expression to change the color of that solid:

 

eval("var mainColor=" + footage("bogus.json").color);

mainColor[0].MainColor

 

However I keep getting the error "Error: TypeError: cannot read property of '0' of undefined"

Does anyone know what I would need to change to get it to read the color value in the JSON?

This is what my JSON script looks like.

 

Screen Shot 2019-04-25 at 1.43.21 PM.png

This is a full picture of the expression on the color control

Screen Shot 2019-04-25 at 1.44.35 PM.png

How to launch a javascript with DoCommand in C++?

$
0
0

Summary: Whenever I use AEGP_DoCommand in C++ to trigger a menu item that launches a Javascript file, AE crashes after executing that JS file.

 

I’m developing a script (javascript) that creates layers and automates multiple actions. Complementary with that is an effect (C++ plugin) that has no visible influence on the footage, but has a number of parameters (colours, sliders, buttons). The layers generated with javascript are linked with expressions to the effect’s parameters, so we can controls them throughout the different comps.

 

One of the parameters is a button that should start a bunch of actions. Those are all written in a javascript file that works on it’s own. To launch that javascript file from the C++ effect I use:

 

----suites.CommandSuite1()->AEGP_DoCommand(8109);

 

to trigger the menu item that corresponds to that script (File > Scripts > TheScript.jsx)  (I found the ID with a simple script that uses app.findMenuCommandId() like suggested in the SDK guide.)

 

That script runs perfectly fine, I can still display an alert on the last line of the file.

Right after that script is done (and maybe when the AEGP_DoCommand function returns), After Effects crashes with the error attached. (BEE_WorkQueue)

After Effects Crash Error.png

To debug this, I tried launching a really simple script (attached below) that just makes a new null.

That first executes, but right after, AE still crashes with the same error.

SampleScript.png

 

After this I tried doing a different command, like ‘Play/Pause’ (ID: 10314) and that worked perfectly fine, without any crashes.

 

I also looked into AEGP_ExecuteScript, but we have a pretty complicated script that applies presets and we lose the references to the presets when using ExecuteScript.

 

Is there a way to launch a script from the menu with the DoCommand function?

 

I hope my explanation makes sense, let me know if I can provide any more information!

 

Thank you!

Ben Klewais


CC2017 New Output Module template by script

$
0
0

Is there any way to create new Output Module template via script which I can use afterwards?

You see I know I can make it beforehand "manually" via "Edit > Templates > Output Module > New..." but I want to have kind of universal solution (script) that would work right away even with just one click even in a fresh (re-)install of AE (sure, in case one have required codec(s))

Extendscript add Output Module Template - FEATURE REQUEST-

$
0
0

FEATURE REQUEST:

 

It would be nice to have a "Template" Object for Output Module Templates in Extendscript.

Maybe implemented under app.project.template / app.project.omTemplate

 

This Template Object would contain following variables and methods:

 

Template.name => Contains a String with the Name of this Output Module

Template.videoOutput => Boolean if video should be exportet

Template.audioOutput => String of the 3 different Audio Options { }

Template.video => Object containing the video format, the channels to render, bit depth, color settings, bool if composition frame numbering is used

Template.changeVideoSize => Array of the new dimensions [float, float]

Template.crop => Array of the crop [float top, float left, float bottom, float right]

 

Template.create(boolean overwrite) => adds a template to the Output Modules. If one module already exists it should be possible to specify with the boolean "overwrite"

                    to overwrite this template. This method should return "True" if the template was succesfully created and "False" if one variable

                    refers to a wrong setting and thus the template could not be created.

 

 

Why is this feature important ?

 

Currently the way we distribute our rendersettings in our company is by sending an AOM file with our templates. The templates are very important because we render via a renderscript with the aerender.exe . Sometimes our artists create templates by themself with the same naming as a new project template. In this case our template from the AOM file won't be imported and thus the renderscript can't execute its function.

By setting rendertemplates via extendscript it would be possible to distribute single project based rendersettings

to different artists as well as to a renderfarm.

 

 

This is just a proposal! Would be really nice if someone could add some improvements / tell us their opinion.

Best regards

CEP panel background color

$
0
0

Hi guys,

 

I've notice my CEP panel background is not as dark as a normal panel.

Is there any way to achieve that?

Annotation 2019-04-26 232620.png

My body class is <body class="hostBgd">.

I've also tried <body class="hostElt"> with the same result,

and <body class="hostBgdDark"> which is actually even lighter.

Script to Comp Duration

$
0
0

I have "Main Comp" with 30 seconds of time, and inside have:

A footage called "Forest"

 

I want to replace Footage which can vary of time, being greater, like 59 seconds for example, so I need wich the "Main Comp", also adjusts according to Footage time duration. "Main Comp" staying with 59 seconds.

 

Thanks.

How do Spatial Tangents Work (After Effects Scripting)?

$
0
0

Consider the problem of making a layer move along a perfectly circular path about the center of the composition.  I found that this seems to be possible by manually choosing the value of the spatial tangents at points of the circle using scripting:

 

var width = 1920
var height = 1080

mycomp = get_comp_by_name("BACK")
var testlayer = mycomp.layers[1]
var radius = 150
var x_offset = width/2
var y_offset = height/2
var magicRatio = 9/16
mycomp.layers[1].property("Position").setValueAtTime(framesToSeconds(0), [-radius + x_offset, 0 + y_offset])
mycomp.layers[1].property("Position").setValueAtTime(framesToSeconds(100), [0 + x_offset, radius + y_offset])
mycomp.layers[1].property("Position").setValueAtTime(framesToSeconds(200), [radius + x_offset, 0 + y_offset])
mycomp.layers[1].property("Position").setValueAtTime(framesToSeconds(300), [0 + x_offset, -radius + y_offset])
mycomp.layers[1].property("Position").setValueAtTime(framesToSeconds(400), [-radius + x_offset, 0 + y_offset])


mycomp.layers[1].property("Position").setSpatialTangentsAtKey(1, [0, -radius*magicRatio, 0], [0, radius*magicRatio, 0])
mycomp.layers[1].property("Position").setSpatialTangentsAtKey(2, [-radius*magicRatio, 0, 0], [radius*magicRatio, 0, 0])
mycomp.layers[1].property("Position").setSpatialTangentsAtKey(3, [0, radius*magicRatio, 0], [0, -radius*magicRatio, 0])
mycomp.layers[1].property("Position").setSpatialTangentsAtKey(4, [radius*magicRatio, 0, 0], [-radius*magicRatio, 0, 0])
mycomp.layers[1].property("Position").setSpatialTangentsAtKey(5, [0, -radius*magicRatio, 0], [0, radius*magicRatio, 0])

 

This will make the layer move in a perfect circle around the center of the composition with a radius of 150 pixels.  We can see this as the result:

 

KqT2qwV.png

 

But you'll notice I have this "magicRatio" of 9/16 defined in the code.  I verified that it has nothing to do with the composition aspect ratio or the layer's aspect ratio; irrespective of those, a perfect circle is always produced.  I only found that ratio by trial and error.

 

So here's my question: why 9/16?  How exactly does setSpatialTangentsAtKey() work?

Viewing all 2143 articles
Browse latest View live


Latest Images

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