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

how to write expression in such case-4

Engaged ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

Hi, 

 

I want to animate somthing. but dnt know how can I do that. I want to take value for position a to b from a trim path animation. but also I want the postion to be above the trim path. I want to make it look like it's floating. wiggle I applied. but I dnt understand how to write the expression. please help. 

 

in blue box green bar animation, I applied the expression. but the box is not above the bar, like the second sceneario. How can I make the box take its position value from trim path and also remain to be above. thank you. 

 

wiggle.gif

 

TOPICS
Expressions

Views

462

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 , Jul 08, 2024 Jul 08, 2024

I think I try something like this:

yOffset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100)) + [0,yOffset] + w

You could certainly replacye the Trim Paths End point with a slider if you want to.

Votes

Translate

Translate
Community Expert ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

I think I try something like this:

yOffset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100)) + [0,yOffset] + w

You could certainly replacye the Trim Paths End point with a slider if you want to.

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
Engaged ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

 

 

Hi Dan, Thank you so much. I did it!! I screamed so loud outta happiness that I think International Space Station's astronuts cud hear me. Thank you. this is so cute.

 

 

dan.gif

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
Engaged ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

Hi Dan,

 

am experimenting. why the expression is not working now?

 

dan 2.gif

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
Community Expert ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

I'm not sure what you're after exactly, but maybe this:

offset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
newP = L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100));
v = p.normalOnPath(L.content("Shape 1").content("Trim Paths 1").end/100);
newP + v*offset + w

You might have to change the sign for offset, depending on how you drew the path.

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
Engaged ,
Jul 09, 2024 Jul 09, 2024

Copy link to clipboard

Copied

Hi Dan,

 

I tried the xpression, it didnt work. I think for closed path it dsnt work. am so sad now. feel like am lost :'(

 

 

 

 

dan 4.gif

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
Engaged ,
Jul 09, 2024 Jul 09, 2024

Copy link to clipboard

Copied

dan 3.gif

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
Community Expert ,
Jul 09, 2024 Jul 09, 2024

Copy link to clipboard

Copied

It looks like you left out the 6th line of the expression:

v = p.normalOnPath(L.content("Shape 1").content("Trim Paths 1").end/100);

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
Engaged ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

 

Yes, My bad. I tried again. it works now, but the ball seems intoxicated. it forgets what it shud follow. 

 

dan.gif

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
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

There's definitely something strange going on there. Could you possibly post the project file?

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
Engaged ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

here it is.

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
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

I think it's because for the line, you have Transform Shape 1 Scale not set to 100%,100%. If you change it to 100%, you'll also need to change the offset variable in the expression from -100 to 100 to get the ball on the outside of the line.

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
Engaged ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

Hi,

 

Now I set both 100,100 (scale), but its more bizzare 😮 

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
Community Expert ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

You need to change the first line of the expression to be:

offset = 100;

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
Engaged ,
Jul 10, 2024 Jul 10, 2024

Copy link to clipboard

Copied

LATEST

😮😮now it works!!! 😮 😮 THANK YOU SO MUCH. 😮 😮 😮

 

 

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