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

Path point linked to null position

Participant ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Untitled-1.jpg

i have a simple expression that links the first point of the shape lazer to a null.

createPath(points = [thisComp.layer("Null 20").transform.position-[960,540], [100,0], [100,100]], inTangents = [], outTangents = [], is_closed = false)

this works untill i move the position of the shape layer. is there a way to tweek this simple expression to make it work even if i move the shape layer?

i am thinking about a toComp command but i dont know how to put it in.

i am also aware of the "Create Nulls From Path.jsx" but i dont want to use it now, i want to keep it simple.

thanks!

TOPICS
Expressions

Views

2.4K

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 , May 22, 2019 May 22, 2019

Try it this way:

createPath([fromComp(thisComp.layer("Null 20").transform.position),[100,0],[100,100]],[],[],false)

Dan

Votes

Translate

Translate
Community Expert ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Try it this way:

createPath([fromComp(thisComp.layer("Null 20").transform.position),[100,0],[100,100]],[],[],false)

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
Participant ,
May 23, 2019 May 23, 2019

Copy link to clipboard

Copied

ehi dan, thanks a lot for the help it works perfectly!

but now i was trying to make it work even if the null is 3d, any idea?

thanks!

i am doing this just to learn some expressions, i still have a long way to go

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 ,
May 23, 2019 May 23, 2019

Copy link to clipboard

Copied

LATEST

Try this:

N = thisComp.layer("Null 20");

createPath([fromComp(N.toComp(N.anchorPoint)),[100,0],[100,100]],[],[],false)

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
Participant ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Hey Matteo, considering how Create Nulls From Path.jsx works - its either points follow nulls, or vice versa.

With this in mind - can you explain the reason why you might want to move it separately? As a different workaround, you could have all points controlled by nulls and when position change is needed, just animate them all.

Unless someone has a solution to pull this through with the parenting null position to shape in a proper way. Cheers.

Edit: based on Dan's response, I kind of imagined it is required that null follows the shape like no path controller is applied, instead of pinning to that initial 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