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

making an expression reference another shape within the same layer

New Here ,
Nov 08, 2019 Nov 08, 2019

Copy link to clipboard

Copied

I'm trying to make a neat lightning effect and I'm stuck.

I want a comp that will create a new segment of path every frame. the start point of each segment will be the end point of the previous segment and the end point will be pointing towards a designated end point with random jitter added in.

I have been able to start on it, building a new shape within the main layer for each segment, but in order to tell these segments where to start, I have had to create a null object that references the end point of the previous segement, and point the start point towards that null. I would like to be able to have the expression on the path automatically point to the end point of the shape directly above it, so that I can just duplicate these shapes over and over and not have to create the null and go in and change the numbers in the expression every single time. I have been having trouble understanding the process of pointing towards another shape within the same layer. If someone could explain what these commands are and how they work, I would be eternally grateful!

Screen Shot 2019-11-08 at 11.45.07 AM.png

TOPICS
Expressions , Scripting

Views

369

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
Advisor ,
Nov 08, 2019 Nov 08, 2019

Copy link to clipboard

Copied

It's not a direct answer to your question... but are you aware of:
Effects > Generate > Advanced Lightning ?

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
New Here ,
Nov 08, 2019 Nov 08, 2019

Copy link to clipboard

Copied

very cool!

that is exactly the sort of thing I'm trying to build.

To be more clear, my ultimate goal is not to create a lightning effect, but to learn how to use expressions. I learn better by doing something than just by reading about it. Thanks for the tip!

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 ,
Nov 08, 2019 Nov 08, 2019

Copy link to clipboard

Copied

First question: Where did you get that expression. I didn't try and copy it to test it but it looks like someone is trying to tie position to a vector path. That will not work.

 

If you want to start learning expressions the first stop is the Expression language reference. Then you should head over to Dan Ebberts https://www.motionscript.com. You'll need to run through both of those sites to start to get a handle on the tool.

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
New Here ,
Nov 12, 2019 Nov 12, 2019

Copy link to clipboard

Copied

LATEST

Hey Rick, 

I wrote that expression myself, and believe it or not, it does work!

thanks for the links, those are super helpful!

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 ,
Nov 09, 2019 Nov 09, 2019

Copy link to clipboard

Copied

While in theory, it should be possible to do what you're trying to do, in practice, the cascading nature of the calculation (where each path's expression has to reference the previous path's points), especially throwing randomness into the mix, things will grind to a halt pretty quickly when you start duplicating the paths. Setting it up would be an interesting experiement, just to know how to do it, but that's about it, I'm afraid.

 

Dan

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