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

Can I create a mask path using points from other masks?

Explorer ,
Dec 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

I feel like this should be possible using an expression but I'm not very good with expressions yet... 

I have a footage layer in a comp. On that layer I have created three masks. Each mask has only one point. I have used each mask to track a different moving object in the footage. 

I want to have one mask with three points, where each point is one of the (tracked) points from the other three masks.

Does that make sense? Maybe I need to first apply the tracking data from the three masks to nulls, and then draw the position information for the ultimate mask from the three nulls? 

I've found a YouTube tutorial where somebody uses a .toComp expression to apply the position of a point on a mask to a null. And I've seen a separate tutorial where a createPath expression is used to define points on a mask. I've tried to combine them but I get lost... 

Alternatively if there is a way to just start with one mask but have each point on the mask be tracking those separate moving objects, that would be even easier... But it seems like all the tracking methods want to treat the points on the mask as if their movements are related to each other, which they are not. 

TOPICS
Expressions , How to

Views

81

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 , Dec 08, 2023 Dec 08, 2023

I you have a layer with 3 single-point masks, and you create a 4th mask, you could use an expression like this for that mask path to incorporate the points from the other 3 masks:

p1 = mask("Mask 1").maskPath.points();
p2 = mask("Mask 2").maskPath.points();
p3 = mask("Mask 3").maskPath.points();
p = [p1[0],p2[0],p3[0]];
createPath(p,[],[],false)

Votes

Translate

Translate
Community Expert ,
Dec 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

I you have a layer with 3 single-point masks, and you create a 4th mask, you could use an expression like this for that mask path to incorporate the points from the other 3 masks:

p1 = mask("Mask 1").maskPath.points();
p2 = mask("Mask 2").maskPath.points();
p3 = mask("Mask 3").maskPath.points();
p = [p1[0],p2[0],p3[0]];
createPath(p,[],[],false)

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
Explorer ,
Dec 08, 2023 Dec 08, 2023

Copy link to clipboard

Copied

LATEST

Thank you so much!! Works perfectly!!

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