• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Trim path follow expression

Community Beginner ,
Jun 25, 2024 Jun 25, 2024

Copy link to clipboard

Copied

Greetings,

I have an expression for a shape to follow the trim path of another shape.

 

var path = thisComp.layer("Shape Layer 3").content("Path 1").path;

var trimPath = thisComp.layer("Shape Layer 3").content("Trim Paths 1").end / 100;

var targetLayer = thisComp.layer("Shape Layer 3");

var point = path.pointOnPath(trimPath);

targetLayer.toComp(point)

 

Would it be possible to account for trim path offset (on the trim paths 1)? 

 

TOPICS
Expressions

Views

89

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 25, 2024 Jun 25, 2024

It's probably going to be something like this, although I'm not sure what should happen when the offset wraps around:

 

 

var targetLayer = thisComp.layer("Shape Layer 3");
var path = targetLayer.content("Path 1").path;
var trimPath = targetLayer.content("Trim Paths 1").end / 100;
var offset = (targetLayer.content("Trim Paths 1").offset%360)/360;
var point = path.pointOnPath((trimPath + offset)%1);

targetLayer.toComp(point)

Votes

Translate

Translate
Community Expert ,
Jun 25, 2024 Jun 25, 2024

Copy link to clipboard

Copied

LATEST

It's probably going to be something like this, although I'm not sure what should happen when the offset wraps around:

 

 

var targetLayer = thisComp.layer("Shape Layer 3");
var path = targetLayer.content("Path 1").path;
var trimPath = targetLayer.content("Trim Paths 1").end / 100;
var offset = (targetLayer.content("Trim Paths 1").offset%360)/360;
var point = path.pointOnPath((trimPath + offset)%1);

targetLayer.toComp(point)

Votes

Translate

Translate

Report

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