Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
1

need a help on trim path animation

Community Beginner ,
Dec 17, 2023 Dec 17, 2023

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.

TOPICS
Expressions , How to , User interface or workspaces
367
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 17, 2023 Dec 17, 2023

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.

 

screenshot.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 17, 2023 Dec 17, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 17, 2023 Dec 17, 2023

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??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 17, 2023 Dec 17, 2023

Where can I get such a script for trim path?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 17, 2023 Dec 17, 2023

50 layers or 1 layer with 50 shapes?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 17, 2023 Dec 17, 2023

Sorry 50 shapes  in one layer

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 17, 2023 Dec 17, 2023

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();

 

screenshot.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 17, 2023 Dec 17, 2023
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines