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

[Help] Path Expression transform

Community Beginner ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

I want to make a mask that references a path elsewhere.
But after I whip linked it, the position of the mask is off.
I tried to use expression to move the points of the mask path, except I cant find the proper function to do that.
Im new and self taught, help.

Screenshot 2022-06-17 at 3.45.35 PM.png

TOPICS
Expressions

Views

168

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 17, 2022 Jun 17, 2022

Shape layers can be weird as they have two sets of coordinates (sort of).  There's the corrdinates of the shape layer itself, then each shape in a layer has its own transform points.  That's my guess as to why the position is not aligned.

 

The challenge you've sound interesting, but it might be there's an easier way to tackle it.  I'm guessing again, but are you trying to use a mask to only show part of a layer?  Track Mattes might be a simpler approach.  You can use the shape layer to cut out

...

Votes

Translate

Translate
Community Expert ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

Shape layers can be weird as they have two sets of coordinates (sort of).  There's the corrdinates of the shape layer itself, then each shape in a layer has its own transform points.  That's my guess as to why the position is not aligned.

 

The challenge you've sound interesting, but it might be there's an easier way to tackle it.  I'm guessing again, but are you trying to use a mask to only show part of a layer?  Track Mattes might be a simpler approach.  You can use the shape layer to cut out the section of a layer below.

 

 

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 Beginner ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

LATEST

Yea, I worked around the issue with Mattes.
For those who are interested, my later experimentations in using expressions worked when I modified to this:

 

mask1=thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
//transform
newmask=[];
for (i=0; i<mask1.points().length;i++){
offsetX=thisComp.layer("Controller").effect("Slider Control")("Slider");
offsetY=thisComp.layer("Controller").effect("Slider Control 2")("Slider");
value = mask1.points()[i];
value=value+[offsetX,offsetY];
newmask.push(value);
}

//create path
mymask=mask("Mask 1").path;

mymask=createPath(newmask,mask1.inTangents(),mask1.outTangents(),true);

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