Skip to main content
Richard Rosenman
Inspiring
November 14, 2022
Question

How to get mask / shape data from another layer?

  • November 14, 2022
  • 3 replies
  • 611 views

Hi gang;

 

I have followed the PathMaster project to understand how to get mask shapes and work with them. I implemented something similar in my project and it works great.

 

However, the PathMaster project can only read data from it's own layer so you cannot have shapes. As such, I have been searching to find examples on how to get mask or shape data from another layer, other than the effect layer.

 

I recall a long, long time ago seeing a post on here that had perfect example code on how to do that but I've been searching for the past hour and can't seem to find it.

 

Any suggestions or help on how to achieve that?

 

Thank you in advance!

-Rich

This topic has been closed for replies.

3 replies

Mylenium
Legend
November 15, 2022

I'm not into plug-in programming, so I can't answer the specifics. I only occasionally dig into the docs to keep up with latest development. The way I understand your request, you'd have to implement any UI widget as custom code since, again, you cannot actually access the shape layer infrastructure. Paths themselves are "cast", meaning you use the mask APIs and your own code to create the structure and then simply blindly fire them at the property stream for the shape path (which you can add as a generic prop stream). Then apparently it's a lot of finger-crossing and hoping you did not mess up and AE handles the data type conversion. Anyway, perhaps one of the AEGP savants will chime in and has better answers for you.

 

Mylenium

Mylenium
Legend
November 14, 2022

The way I remember it you "cast" the mask data as a shape layer property stream and manipulate it back and forth since shape layers apparently are not accessible otherwise in the public API.

 

Mylenium

Richard Rosenman
Inspiring
November 15, 2022

Hi Mylenium;

 

Thanks for your reply. I thought I could use the same technique mentioned in this thread to grab the layer handle, only I'm not sure how to apply it to PF_CheckoutPathhttps://community.adobe.com/t5/after-effects-discussions/aegp-layerh-from-a-pf-param-layer/td-p/6303963

 

Anyway, perhaps I'm confused and going down the wrong road altogether... ?

 

Regards,

-Rich

 

P.S. Rick, my thread is marked SDK so it is a development specific question.

James Whiffin
Legend
November 18, 2022

AFAIK the only way to access shape data in the SDK is to have a mask path param and set it's value to the shape layer's path via expressions. Would be very happy to be wrong on this if anyone has a different way!

Community Expert
November 14, 2022

I am not familiar with Pathmaster. Do you have a link? 

 

I have no idea what you are trying to accomplish. You can link masks to shape layer paths with a simple pickwhip. You cannot link masks to parametric shapes like Rectangles or Polygons unless you convert them to Bezier Paths.