ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Modify Script

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Allen joaquin
Modify Script
on Jun 5, 2012 at 12:08:50 pm

Hi, i've recently downloaded the videocopilot script to Precompose which is really usefull but i would like to modify it so that it dosen't actually create a folder and inside the folder the precomposition.

Is that possible? here's the Script: http://www.mediafire.com/?c7axcug9ueea5t5

I took at look at it and i don't actually know how to modify it : (

Here's the script's code

{
function precompTrim()
{
var curComp = app.project.activeItem;
if (!(curComp instanceof CompItem))
{
alert("Please select a composition.");
return;
}

var layers = curComp.selectedLayers;
if (layers.length == 0)
{
alert("Please select one or more layers.");
return;
}

app.beginUndoGroup("Precomp and Trim Layers");

var compFolder = prompt("Comp Folder Name", "Trimmed Comps");

var projItems = app.project.items;
for (var i=1; i<=projItems.length; i++)
if (projItems[i].typeName == "Folder" && projItems[i].name == compFolder)
{
compFolder = projItems[i];
break;
}

compFolder = app.project.items.addFolder(compFolder);

var offset = parseInt(prompt("Add Handles (frames)", "0"));
offset = offset * curComp.frameDuration;

for (var i=0; i<layers.length; i++)
{
var preCompName = layers[i].name + " Precomp";

var preCompIndices = new Array();
preCompIndices[0] = layers[i].index;

var inPoint = layers[i].inPoint-offset, outPoint = layers[i].outPoint+offset;

var duration = outPoint - inPoint;

layers[i].startTime -= inPoint;
layers[i].inPoint = 0;
layers[i].outPoint = duration;

var preCompItem = curComp.layers.precompose(preCompIndices, preCompName, true);
preCompItem.duration = duration;
preCompItem.parentFolder = compFolder;
preCompItem.workAreaStart = 0;
preCompItem.workAreaDuration = preCompItem.duration;

var preComp = curComp.selectedLayers[0];
preComp.startTime = inPoint;
preComp.inPoint = inPoint+offset;
preComp.outPoint = outPoint-offset;
}

app.endUndoGroup();
}

precompTrim();
}



[B]Sorry i figured it Out!!![/B]

I'll leave what i did here just in case someone is looking for the same i did u just need to delete this lines

app.beginUndoGroup("Precomp and Trim Layers");

var compFolder = prompt("Comp Folder Name", "Trimmed Comps");

var projItems = app.project.items;
for (var i=1; i<=projItems.length; i++)
if (projItems[i].typeName == "Folder" && projItems[i].name == compFolder)
{
compFolder = projItems[i];
break;
}

compFolder = app.project.items.addFolder(compFolder);

var compFolder = prompt("Comp Folder Name", "Trimmed Comps");

var projItems = app.project.items;
for (var i=1; i<=projItems.length; i++)
if (projItems[i].typeName == "Folder" && projItems[i].name == compFolder)
{
compFolder = projItems[i];
break;
}

compFolder = app.project.items.addFolder(compFolder);

var offset = parseInt(prompt("Add Handles (frames)", "0"));
offset = offset * curComp.frameDuration;


preCompItem.parentFolder = compFolder;



Return to posts index

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