Hi
Where can I find documentation for new scriptui and expression changes in AE 2018?
Thanks,
Jakob
Hi
Where can I find documentation for new scriptui and expression changes in AE 2018?
Thanks,
Jakob
Did something change around the CEP extensions in AE 2018? Doesn't seem to pick up things from C:\Program Files (x86)\Common Files\Adobe\CEP\extensions anymore.
Previous versions of AE work fine, does it look in a different place now? Even added 15.0 to the manifest's host list, no difference.
Is there a way to retrieve all the attributes names of a XML element?
Say i have this xml:
var fruit= <Banana weight="158.3kg" length="2.03m" origin="Kepler-186f"/>;
fruit.children() and fruit.elements() do not list attributes.
fruit.attributes() only lists the values, not their names.
I would like to retrieve the attributes names, ie "weight", "length", "origin".
It's possible by parsing fruit.toXMLString(), but.. i'd rather not do that(!)
Any suggestion ?
Xavier
Hi, I started a thread here about the project I'm working on: https://forums.adobe.com/thread/2398912
As Dan Ebberts suggested, I should create a script out of what I was trying to achieve. My project structure looks like this.
Main Comp (which is the active comp):
MIDI Control comp:
Here's the expression I was using on each individual checkbox control for activeLeftHand and activeRightHand layers if it's of any use. Also modified from something Dan Ebberts helped me out with a while back:
midiNote = comp('Main comp').layer( 'midi' ).effect( 'ch_0_pitch' )( 'Slider' ); midiNum = thisProperty.propertyGroup(1).name; n = 0; for (i = 1; i <= midiNote.numKeys; i++){ if (midiNote.key(i).time > time) break; if (midiNote.key(i).value == midiNum) n++; } if (n%2) 1 else 0
I've got this far but need to complete the section for lines 26-27:
var proj = app.project; // The Application Object is at the top level followed by the Project Object. var comp = proj.activeItem; // Set the comp variable to the active composition. var midiLayer = comp.layer("midi"); // Set the 'midi' layer of the active composition to a variable. var leftHandKeys = midiLayer.effect("ch_0_pitch")("Slider"); // Get channel_0_pitch values - used for left hand notes. var rightHandKeys = midiLayer.effect("ch_1_pitch")("Slider"); // Get channel_1_pitch values - used for right hand notes. var midiControlComp = comp.layer("MIDI Control").source; // Set the 'MIDI Control' composition to a variable. var leftHandController = midiControlComp.layer("activeLeftHand"); // Get the checkbox control layer for the left hand. var rightHandController = midiControlComp.layer("activeRightHand"); // Get the checkbox control layer for the right hand. // TODO: At the end use the following to run the function. // midiDataToControlComp( leftHandKeys, leftHandController ); // midiDataToControlComp( rightHandKeys, rightHandController ); function midiDataToControlComp(channelPitchSlider, checkBoxControlLayerName) { // If there are keyframes available, continue. if (channelPitchSlider.numKeys > 0) { for (k = 1; k <= channelPitchSlider.numKeys; k++) { // Break loop if the keyframe's time more than the current time. if (channelPitchSlider.key(i).time > app.project.activeItem.time) break; // TODO: Get keyframe(s) value and assign it to the corresponding checkbox(es) on the checkBoxControlLayerName layer. // IMPORTANT NOTE: There may be MIDI chord data at a given time which means there will be multiple keyframes stacked. Get all values out. } // If there are no keyframes availble, display an error alert. } else { alert("There are no keyframes in " + channelPitchSlider + " within the midi layer."); } // End if statement. } // End midiDataToControlComp() function.
Not sure if line 24 is also doing its job too.
If anyone can help me out here that would be brilliant.
Thanks!
Hi
When I do this it will draw a line, but the alert line will break the script:
var shapeLayer = comp.layers.addShape();
shapeLayer.name = "Shape Layer";
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.name = "Group";
var pathShape = new Shape();
pathShape.vertices = [[0,0],[100,100]];
pathShape.closed = false;
var pathGroup = shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Group");
pathGroup.property("Path").setValue(pathShape);
var pathStroke = shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
pathStroke.property("Color").setValue([0,0,0]);
pathStroke.property("Stroke Width").setValue(4);
alert(pathGroup.property("Path").value);
Why is that? Problem is, I need to send that path value to another function and when I do that it breaks.
Thanks,
Jakob
Hi there,
I've stumbled upon a problem/bug while writing something to sync text layer's attributes.
To replicate:
- In the UI, set a text layer's stroke/fill behaviour to "Fill Over Stroke" (keep the item selected)
- Run this code:
$.writeln(app.project.activeItem.selectedLayers[0].property("Source Text").value.strokeOverFill)
- It returns 'false'. So far, so good.
- Now change the value in the UI to "Stroke Over Fill" and run the above code again
- It returns 'true'. Very nice.
- Change the value in the UI to "All Fills Over All Strokes" and run the code again
- It returns 'true'. Wrong! It should return false.
- Change the value back to "Fill Over Stroke", run the code (this is just to verify that this option returns the right value)
- It returns 'false', which is correct.
- But if you now change the value to "All Strokes Over All Fills" and run the code it still returns 'false'.
After looking at the results of the above test, it seems that the latter two options in the list ("All Fills Over All Strokes" and "All Strokes Over All Fills") don't affect the variable available to the JavaScript API, but only the first two options ( "Fill Over Stroke" and "Stroke Over Fill").
This is quite annoying when trying to sync up many text layer's properties accurately.
I'm on AE CC 2015 (13.5.0.347) on OSX
I suppose there is not really a workaround since accessing text attributes is already quite limited, but if anyone has some good ideas, let me know.
i have script:
var x = app.project.item(3).layer(1);
newMask = x.Masks.addProperty("Mask");
newMask.inverted = true;
myMaskShape = newMask.property("maskShape");
myShape = myMaskShape.value;
myShape.vertices = [[930,450],[930,570],[1050,570],[1050,450]];
myShape.closed = true;
myMaskShape.setValue(myShape);
it only allows me to create square masks. how do i create circles? or masks made of more than 4 points?
i have script:
var thisLayer = app.project.item(3).layer(1);
newMask = x.Masks.addProperty("Mask");
newMask.inverted = true;
var myShape = new Shape();
myMaskShape = newMask.property("maskShape");
myShape = myMaskShape.value;
myShape.vertices = [[300,50],[200,150],[300,250],[400,150]];
myShape.inTangents = [[55.23,0],[0,-55.23],[-55.23,0],[0,55.23]];
myShape.outTangents = [[-55.23,0],[0,55.23],[55.23,0],[0,-55.23]];
myShape.closed = true;
myMaskShape.setValue(myShape);
var x1 = app.project.item(3).layer("1.3.2017 a1").property("Masks").property("Mask 1").property("Mask Feather")
x1.setValueAtTime([0], [20.0, 20.0]);
it creates for me a circle mask. question is what if i wanted the mask to be created elsewhere. how would i figure out the tangents for it. or how can i create a mask with the pen tool first and then see what its tangents are?
So I've come across an issue with a script I'm currently writing.
Basically if you undo after using 'copyToComp' on a layer with effects on it it will crash AE (at least it does on 14.2.1).
Has anyone else encountered this issue?
Hi There,
I may be the only one who has this opinion, but I'll throw it out there for discussion anyways. I'm not a huge fan of the Adobe Extendscript Toolkit IDE. I use it mainly on OSX and there are so many things that are fundamentally flawed with it. For example, on the OSX version, when you go to change the colors for the document, they list the acutal color names, but if you choose a color that has two words in it, for example "Aqua Marine" nothing changes. There are other issues I have with it that make it feel like it's a work in progress tha Adobe puts on the backburner.
I'm just curious if there is an alternative IDE that people use whereby you can still target the application you are scripting for? I am a Coda user and would love to see a plugin written for that app. If you have any suggestions for an alternative IDE for developing in Extenscript, please do post!
Thanks for your time and help!
Hello,
my extension is based on After Effects project files. Unfortunately every time after import (new ImportOptions().file = new File()) After Effects changes default path and auto-saves user projects in extension location. It's a serious problem for me, because any single change in extension file hierarchy disabling the certificate and user no longer can run the panel. What can I do?
As it currently stands, I've got this far with my piano project:
Synthesia Piano Built Completely in After Effects! - Update 3 [WIP] - YouTube
Here's the script I've written (thanks to Dan's help) if it helps understand the project file:
Stuck with this 'keyframes to checkbox controls' script I'm writing
My current situation is that I want to get a piano roll going, something like this first draft of the piano project I have:
I just don't know the most practical way of doing so.
I have 88 checkbox control layers for both hands (blue and pink colours indicate both hands), making it a total of 176 control layers.
Each checkbox is labelled by the midi number:
Possibly thinking I could do this with a script that generates rounded rectangles (with varying heights) based on how long a piano key is staying active for, offsetting them all out of view and then making them reach the correct key note at the time it is being played.
Something like a sequencer-style layout that runs vertically.
Maybe having some kind of while loop that increases the rectangles height by 1px each time it is staying active etc (just getting my thoughts out there before I forget).
Don't know where to begin as this is my first ever AE project and I've decided to take a plunge into the deep end!
Open to suggestions and better ways of achieving this effect without having crazy rendering times.
Thanks.
E
Aloha AE friends...
Does anybody know something about how to create a purchase code validation system using Envato API code?
Or another kind of system to fight against piracy?
Is it possible to do something like this using a User Interface in JAVASCRIPT?
Or this is only possible with CEP Panels?
Can anybody help me, please? Somebody know if this kind of code is for sale in some place?
Thanks.
Rubens Nobre
How can you determine when the animation ends, starts (duration) if it is set with expressions?
To make things worse, the expression is precompiled(not sure if that is the word). By that I mean it uses eval function with some "nonsense" inside it.
Something like this: eval('@JSXBIN@ES@2.0@MyBbyBn0AKJAnABjzGjPjGjGjTjFjUBfEEjzGjFjGjAndSoOn');
I've been told that I need to calculate the keyframes, but didn't really get this instruction. Animation->Keyframe Assistant->Convert Expression to Keyframes returns keyframe on every frame, (and also breaks the animation) so that isn't really helpful.
Hello community.
I am looking for a way to create a template for a series I am working on.
I made a base template with a comp called _SCENE. This is the work composition and I am trying to get all elements in this comp when importing.
So far so good, till I want to import a .psd.
I seem not to find that part of code (I am REALLY new to coding) that gives me the standard after effects pop-up window, when importing manually a photoshop document.
Could you help me out please?
Cheers,
Marc Konings
here is the code I have till now:
/* TEMPLATE AE COMPOSITING production name */
// MK
// version 15062017-002
var currentFootageItem;
var maDate=new Date();
var myfps=25;
var mySearch=/EP000_SC000/;
var nom=prompt("Episode and Scene number :","EP000_SC000","production name AE");
var myDuree=prompt("Frames : ","480","production name AE")/25;
var z,z1=false;
var myDoc = app.activeDocument
var myProject = app.project.items;
var q = app.project.renderQueue.items
var folderProjectName = myProject.addFolder(nom);
var folderScene = myProject.addFolder("07_SCENE");
var folderRenderComp = myProject.addFolder("RENDER_COMPS");
var folderOther = myProject.addFolder("05_OTHER");
var folderComps = myProject.addFolder("06_COMPS");
var folderAnimaticRefs = myProject.addFolder("01_ANIMATIC & REFS");
var folderAnim = myProject.addFolder("02_ANIM");
var folderBg = myProject.addFolder("03_BG");
var folderFx = myProject.addFolder("04_FX");
folderScene.parentFolder=folderProjectName;
folderRenderComp.parentFolder=folderProjectName;
folderOther.parentFolder=folderProjectName;
folderComps.parentFolder=folderProjectName;
folderAnimaticRefs.parentFolder=folderProjectName;
folderAnim.parentFolder=folderProjectName;
folderBg.parentFolder=folderProjectName;
folderFx.parentFolder=folderProjectName;
alert("Choose your ANIMATIC file");
var animatic = File.openDialog("Select ANIMATIC");
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)
}
}
}
alert("Choose your PHOTOSHOP / BG file");
var bg= File.openDialog("Select BACKGROUND / .PSD");
if(bg != null) {
var myImportOptions2 = new ImportOptions();
myImportOptions2.file = bg;
var myBg = app.project.importFile(myImportOptions2);
myBg.parentFolder = folderBg;
//I am struggling here, I seem not to get to choose a .psd AND to choose in what way I want to import this .psd
//It would be awesome if I could import this also instantly in 'comp_SCENE'.
}
{
if(myImportOptions2.canImportAs(ImportAsType.COMP)){
myImportOptions2.importAs = ImportAsType.COMP;
}else{
myImportOptions2.ImportAs=ImportAsType.FOOTAGE;
for (it=myProject.length; it>=1; it--){
if(myProject[it].name==nom+"_SCENE"){
myProject[it].layers.add(myAnimatic)
}
}
}
alert("Choose your ANIMATION folder");
var mySwfFolder = Folder.selectDialog ("Select ANIMATION Folder");
var mySwfFiles = mySwfFolder.getFiles ("*.SWF");
for(var i = 0; i < mySwfFiles.length; i++){
var myImportOptions3 = new ImportOptions();
myImportOptions3.file =mySwfFiles[i]
var mySwf = app.project.importFile(myImportOptions3);
mySwf.parentFolder = folderAnim;
for (it=myProject.length; it>=1; it--){
if(myProject[it].name==nom+"_SCENE"){
myProject[it].layers.add(mySwf)
}
}
};
for (i=app.project.numItems; i>=1; i--){
if(mySearch.test(myProject[i].name)){
myProject[i].name=myProject[i].name.replace(mySearch,nom)
myProject[i].duration=myDuree;
z=true;
if(myProject[i].name==nom+"_NOMENCLATURE"){
for(j=1;j<=myProject[i].numLayers;j++){
if(mySearch.test(myProject[i].layer(j).name)){
myProject[i].layer(j).sourceText.setValue(nom);
myProject[i].layer(j).name=nom;
z1=true;
}
}
}
}
}
if(z&&z1){
// Folder creation + variable of each ones creation b = folderProjectName
for (i2=myProject.length; i2>=1; i2--){
if(myProject[i2].name==nom+"_SCENE"){myProject[i2].parentFolder=folderScene;}
if(myProject[i2].name==nom+"_QT_T1"){myProject[i2].parentFolder=folderRenderComp;}
if(myProject[i2].name==nom+"_NOMENCLATURE"){myProject[i2].parentFolder=folderOther;}
if(myProject[i2].name==nom+"_CONFO_T1"){myProject[i2].parentFolder=folderRenderComp;}
if(myProject[i2].name==nom&&!(myProject[i2] instanceof FolderItem)){
myProject[i2].parentFolder=folderProjectName;
myProject[i2].selected=true;
currentFootageItem=myProject[i2]
}
myProject[i2].selected=false
}
function aff_Date(x){
if(x>9){
return x;
}
else{
return "0"+x;
}
}
var d=app.project.saveWithDialog();
var e=app.project.file.path;
var f=app.project.file.fsName;
var h = e.toString().split("/");
h.pop();
var g="";
for (i=0;i<h.length;i++){
g=g+h[i]+"/";
}
g=g+ "OUTPUT_"+nom+"/" + nom + "_QT_T1_"+maDate.getFullYear().toString().substring (2,4)+aff_Date(maDate.getMonth()+1)+aff_Date(maDate.getDate());
var curItemQ = q[1];
var curItemQOut = curItemQ.outputModule(1);
// var oldLocation = curItemQOut.file;
curItemQOut.file = new File(g);
var w="";
for (i=0;i<h.length;i++){
w=w+h[i]+"/";
}
w=w+ "OUTPUT_"+nom+"/" + nom + "_CONFO_T1_[#####]_"+maDate.getFullYear().toString().substring (2,4)+aff_Date(maDate.getMonth()+1)+aff_Date(maDate.getDate());
var curItemQ = q[2];
var curItemQOut = curItemQ.outputModule(1);
// var oldLocation = curItemQOut.file;
curItemQOut.file = new File(w);
}
else{
alert ("Script stopped working : The AE project doesn't look like a copy of the template: EP000_SC000.aet" , "Production name AE", true)
}
What command to add video to After Effects?
For example, the file "C:/Users/jamesc/video.mp4" needs to be added into my AE.
How do I add it in as a resource and then put it into the composition?
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.
Hi there!
Hope you can help me, with this expressions challenge. My objective is to position a 10 second preComp in a master comp using expressions.
I would like to be able to enter a frame number in a TEXT layer. When I hit enter, an expression re-positions my preComp to start at that specified frame.
How can I achieve this? I can place a script in the TEXT layer that displays the inPoint of a composition. But I'd like it to be the other way around.
Is this achievable in After Effects?
POSSIBLE LONG MESSY APPROACH: I think I could create a mastercomp with hundreds of the same preComps and set each preComp with code that enables visibility for that specific preComp if a text layer has the right number for that layer. It would work but I'm sure there must be a much faster more logical approach. I can't think of it, so hopefully you can help me out.
Thank you so much,
Patricio