FORUMS: list search recent posts

Extendscript: Add solids to a comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Hamid Rohi-Bilverdy
Extendscript: Add solids to a comp
on Jun 16, 2015 at 7:30:02 pm

Hi

My code below dont generate any solids from my array into a comp.

Basicly I want to add 2 solids with specifik names from an array, into comp number 1. But nothing happends.. Any thoughs??


app.beginUndoGroup("add 2 solids");

var proj = app.project;
var mySolids = new Array("SolidOne","SolidTwo");
var numSolids = mySolids.lenght;

for(var i=0; i <= numSolids; i++ ){
proj.item(1).layers.addSolid([0.5, 0.5, 0.5], mySolids[i], 1920, 1080, 1.0, 5);
}

app.endUndoGroup();


Return to posts index


Dan Ebberts
Re: Extendscript: Add solids to a comp
on Jun 16, 2015 at 7:52:15 pm

You had a couple of typos. This seems to work:


app.beginUndoGroup("add 2 solids");

var proj = app.project;
var mySolids = new Array("SolidOne","SolidTwo");
var numSolids = mySolids.length;

for(var i=0; i < numSolids; i++ ){
proj.item(1).layers.addSolid([0.5, 0.5, 0.5], mySolids[i], 1920, 1080, 1.0, 5);
}

app.endUndoGroup();



Dan



Return to posts index

Hamid Rohi-Bilverdy
Re: Extendscript: Add solids to a comp
on Jun 16, 2015 at 8:31:45 pm

Thank you Dan... Works perfectly.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]