Copy link to clipboard
Copied
I have multiple paths in single layer, if i use trim path for this layer... then am getting one path after another continouly, but i need some little break (like 5 to 10 frames) in between each path... Please provide the expression that I could use for a pause of few seconds between each path.
Copy link to clipboard
Copied
The simplest approach is to create one Trim Path for each shape.
Using expressions, it should be possible if your paths don't contain bezier curves.
Copy link to clipboard
Copied
Hi thanks for replying, but I have more than 50 layers this method takes much time that's why I'm looking for some expressions or short cut
Copy link to clipboard
Copied
Then, you'll need to use a script to add a trim path property and keyframes to each shape.
But how do you determine the animation duration for each path, is it fixed??
Copy link to clipboard
Copied
Where can I get such a script for trim path?
Copy link to clipboard
Copied
50 layers or 1 layer with 50 shapes?
Copy link to clipboard
Copied
Sorry 50 shapes in one layer
Copy link to clipboard
Copied
I wrote this code; you can edit the initial variables. (pathDuration and timeBreak)
I hope you have the same hierarchy as I do.
function framesToTime(frames) {
return thisComp.frameDuration * frames;
}
var proj = app.project;
var thisComp = proj.activeItem;
// in seconds or use framesToTime(15) for 15 frames
var pathDuration = 5;
var timeBreak = .5;
if (!thisComp.selectedLayers.length) {
alert('Select a shape layer');
}
app.beginUndoGroup("Undo");
var selectedLayer = thisComp.selectedLayers[0];
var currentTime = 0;
for (var i = 1; i <= selectedLayer.content.numProperties; i++) {
var shapeGroup = selectedLayer.content.property(i).property("ADBE Vectors Group");
var trimPath = shapeGroup.addProperty("ADBE Vector Filter - Trim");
trimPath.property("ADBE Vector Trim End").setValueAtTime(currentTime, 0);
trimPath.property("ADBE Vector Trim End").setValueAtTime(currentTime + pathDuration, 100);
currentTime += pathDuration + timeBreak;
}
app.endUndoGroup();
Copy link to clipboard
Copied
Thank you, really appreciate your time and work.
Since each shape has different length, can the pathDuration variable be set dynamically in correspond to the length of the shape? I will send you my work in DM for clear understanding.