Page 1 of 1
Automaticly making precomps i select with same length
Posted: July 12th, 2008, 7:54 am
by tillimanjaro
Hello,
Im a final cut pro user.
If i need to color correct or make some animations on it, i use AE for it.
Im using the magnum edit detector to cut it back in peaces.
Is there a script that can make a precomp from clips i select and also make the length of the clip(so the clip is at the beginning), instead of doing manualy, somewhere? If so i can make the animations in that precomp and later replace comps if needed.
Thx
Mr T.
Re: Automaticly making precomps i select with same length
Posted: July 12th, 2008, 12:46 pm
by redefinery
tillimanjaro wrote:Is there a script that can make a precomp from clips i select and also make the length of the clip(so the clip is at the beginning), instead of doing manualy, somewhere?
hi mr. t,
will this script do what you need?
http://www.redefinery.com/ae/view.php?i ... re-compose
:jeff
Re: Automaticly making precomps i select with same length
Posted: July 12th, 2008, 2:27 pm
by tillimanjaro
Thx Jeff,
It does the right thing but only if you select one.
If i select different(cutted)clips it just makes one precomp from all the clips? Thats just fine, but if im dealing with 60 cuts, that a pain...
Any more help?
redefinery wrote:tillimanjaro wrote:Is there a script that can make a precomp from clips i select and also make the length of the clip(so the clip is at the beginning), instead of doing manualy, somewhere?
hi mr. t,
will this script do what you need?
http://www.redefinery.com/ae/view.php?i ... re-compose
:jeff
Re: Automaticly making precomps i select with same length
Posted: June 15th, 2009, 6:16 am
by Redsandro
Hi,
I bet you found another solution, but I've written this script for that purpose.
I thought I'd share it anyway because it's been the ultimate time saver for me.
Code: Select all
/**********
* LayerNumbers
**********
* Filename: RED Precomp Layers Headroom.jsx
* Written by: Redsandro - http://www.rednet.nl/en/
* Date: 2009/02/15
* Last updated: 2009/06/11
**********
*
* Description:
*
* UNshy layers to precomps with headroom
*
**********/
/* MANUAL CONFIG */
// Do you want each preComp to begin at frame 0 (true) or just have an in and out point in the entire segment (false)?
var resetComps = true;
/* MANUAL CONFIG */
clearOutput();
var myComp = app.project.activeItem;
if (myComp == null) {
alert("No composition selected.");
}
else {
// Vars
var allLayers = myComp.layers;
var fDuration = myComp.frameDuration;
var headroom = "25";
headroom = parseInt(prompt("How much frames headroom per layer do you want?", headroom));
headroom *= myComp.frameDuration;
app.beginUndoGroup("Precomp Layers");
// Walk layers
for (var l = allLayers.length; l> 0; l--) { // BACKWARDS! Or index changes after each precomp! Index NOT zerobased. //Selfnote: Actually I thought it was but this works.
// Vars
var layer = allLayers[l];
// Precompose
//allLayers.precompose();
if (!layer.shy && !layer.timeRemapEnabled) { // timeRemap gaat fout bij precompen in CS3 (geloof ik)
// Read old values
var inPnt = layer.inPoint; // Note: inPnt is parent comp, so from footage point of view inPnt = startTime + inPnt
var outPnt = layer.outPoint;
var startTime = layer.startTime; //201
// Make comp
myComp = allLayers.precompose([layer.index],layer.name);
// fix comp
if (resetComps == true) { // Make preComp length equal to active segment
// Headroom Check
var headLead = headroom;
// var headTrail = headroom; // headTrail fail because there's no layersource.duration function (by heart)
while ((inPnt - startTime) < headLead) {
headLead--;
}
// Crop segment to frame 0
myComp.layers[1].startTime = -(inPnt-startTime)+headroom;
myComp.layers[1].inPoint = 0+headroom;
myComp.layers[1].outPoint = outPnt-inPnt+headroom;
// Set workArea to active segment in preComp
myComp.workAreaStart = headroom;
myComp.workAreaDuration = outPnt-inPnt;
// Set new comp length to active segment
myComp.duration = headroom+(outPnt-inPnt)+headroom;
// Adjust parent comp for new layer timing
allLayers[l].startTime = inPnt-headroom;
allLayers[l].inPoint = inPnt;
allLayers[l].outPoint = inPnt+(outPnt-inPnt);
}
else { // Make preComp length equal to total segment
// Selfnote: Not prepared for headroom!
// Set workArea to active segment in preComp
myComp.workAreaStart = inPnt;
myComp.workAreaDuration = outPnt - inPnt;
// Restore active segment for preComp
allLayers[l].inPoint = inPnt;
allLayers[l].outPoint = outPnt;
}
// Change mycomp length
}
}
app.endUndoGroup();
}