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

How to make an object, lets say a circle, move along a path, while always being tangential to path

Community Beginner ,
Aug 09, 2023 Aug 09, 2023

Hello, like the title says, how do u make a shape or object be tangential to the path at every point of the path, regardless of the shape of the path?

TOPICS
Expressions , How to , Scripting
1.8K
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

correct answers 1 Correct answer

Community Expert , Aug 09, 2023 Aug 09, 2023

If you have a motion path you want to follow, Shift + Parent a null to the motion path, set the Null to Auto Orient to the motion path, then Shift + parent the Circle to the Null and offset the Y position of the circle by the radius of the circle. 

 

If you want to follow a shape layer path or a mask path, select the path in the timeline, open Window/Create Nulls From Paths.jsx and select Trace Path, then Shift + Parent the Circle (with the anchor point in the center) to the Trace null and offse

...
Translate
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Layer > Transform > Auto-Orient... (Option + Command + O, macOS)

 

 

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 ,
Aug 09, 2023 Aug 09, 2023

that doesnt seem to work. to be clear, i have made a custom path with the pen tool, then a circle shape on a new shape layer. i set the anchor point of the second shape layer to be in the center of the circle and i copied the path property of the first layer to the position property of the second. this made the circle center coincide with the starting point of the path, where i want to make the circle be tangent to the 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
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Auto-Orient works based on the Motion Path of the Layer's Position property.

 

For what you have described, you'll need to keyframe the Rotation of the circle such that it coincides with the motion.

 

 

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 ,
Aug 09, 2023 Aug 09, 2023

can i do that automatically?

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 Expert ,
Aug 09, 2023 Aug 09, 2023

If you still have access to the path, and it's still representative of the motion path, you could use something like this to adjust the shape's position:

t1 = key(1).time;
t2 = key(numKeys).time;

pct = clamp(time,t1+.001,t2-.001)/(t2 - t1);
path = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
n = path.normalOnPath(pct);
radius = content("Ellipse 1").content("Ellipse Path 1").size[0]/2;
offset = radius*n;
value - offset
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 ,
Aug 09, 2023 Aug 09, 2023

so only via expressions.

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 Expert ,
Aug 09, 2023 Aug 09, 2023

That's probably not the only way, but the path function normalOnPath() will do the heavy lifting part of the vector math involved, so I'd take advantage of that.

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 Expert ,
Aug 09, 2023 Aug 09, 2023

If you have a motion path you want to follow, Shift + Parent a null to the motion path, set the Null to Auto Orient to the motion path, then Shift + parent the Circle to the Null and offset the Y position of the circle by the radius of the circle. 

 

If you want to follow a shape layer path or a mask path, select the path in the timeline, open Window/Create Nulls From Paths.jsx and select Trace Path, then Shift + Parent the Circle (with the anchor point in the center) to the Trace null and offset the position by the radius of the circle. 

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 ,
Aug 09, 2023 Aug 09, 2023

awesome, works like a charm. thank you so much.

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
Engaged ,
Nov 10, 2023 Nov 10, 2023
LATEST

Copy the path proprety of the path and paste it in the circle's position property.

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