The script to change the length of a comp and it's child layers, now also supports changing framerates. And added an expression to match the audio of a layer in a containing comp.
This commit is contained in:
@@ -1 +1 @@
|
|||||||
/* TO DO ␍ Only change lengths of layers whose endpoint is greater or equal to the old comp end point.␍ */␍function getSelectedProjectItems (){␍ var items = [];␍ var p = app.project;␍ for ( var i = 1 ; i <= p.numItems ; i ++ ){␍ var item = p.item(i);␍ if ( item.selected ){␍ items.push(item);␍ }␍ }␍ return items;␍}␍␍function applyNewLength( comp , newLength){␍ comp.duration = newLength;␍ for ( var i = 1; i <= comp.layers.length ; i ++){␍ if (!comp.layers[i].locked){␍ comp.layers[i].outPoint = newLength;␍ }else{␍ comp.layers[i].locked = false;␍ comp.layers[i].outPoint = newLength;␍ comp.layers[i].locked = true;␍ }␍ }␍}␍␍itms = getSelectedProjectItems();␍ for ( var i = 0; i < itms.length ; i ++){␍ applyNewLength( itms[i] , 60);␍}␍
|
/* TO DO ␍ Only change lengths of layers whose endpoint is greater or equal to the old comp end point.␍ */␍function getSelectedProjectItems (){␍ var items = [];␍ var p = app.project;␍ for ( var i = 1 ; i <= p.numItems ; i ++ ){␍ var item = p.item(i);␍ if ( item.selected ){␍ items.push(item);␍ }␍ }␍ return items;␍}␍␍function applyNewLength( comp , newLength){␍ comp.duration = newLength;␍ for ( var i = 1; i <= comp.layers.length ; i ++){␍ if (!comp.layers[i].locked){␍ comp.layers[i].outPoint = newLength;␍ }else{␍ comp.layers[i].locked = false;␍ comp.layers[i].outPoint = newLength;␍ comp.layers[i].locked = true;␍ }␍ }␍}␍␍function applyNewFramerate( comp , newFrameRate){␍ comp.frameRate = newFrameRate;␍}␍␍itms = getSelectedProjectItems();␍ for ( var i = 0; i < itms.length ; i ++){␍// applyNewFramerate( itms[i] , 29.97);␍ applyNewLength( itms[i] ,120);␍}␍
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
//expresion to match the audio of the layer to an audio of a layer in a comp that contains this comp.
|
||||||
|
my_comp = comp("COMPNAME");
|
||||||
|
my_layer = my_comp.layer(thisComp.name);
|
||||||
|
my_layer.inPoint + time
|
||||||
Reference in New Issue
Block a user