Skip to main content
Inspiring
August 2, 2023
Question

Сopying the mask without using the new Shape parameter

  • August 2, 2023
  • 1 reply
  • 190 views

Hi all
The project contains 2 compositions: "Comp 1" and "Pre-comp 1"
Composition "Pre-comp 1" contains two layers
In the second layer of the composition "Pre-comp 1" there is a mask "Mask 1". You want to copy this mask to the first layer of the "Comp 1" composition. Usually the Shape parameter is matched, and a mask is created in the layer based on this parameter. Is there a way to scribble an existing mask with something like this?

app.project.item(1).layer(1).source.layer(2).mask(1).maskPath.selected = true
app.executeCommand(app.findMenuCommandId("Copy"))
app.project.item(1).layer(1).source.layer(2) = false
app.project.item(1).layer(1).selected = true
app.executeCommand(app.findMenuCommandId("Paste"))
app.project.item(1).layer(1).selected = false
This topic has been closed for replies.

1 reply

Community Expert
August 2, 2023

I think you need to include something like the expression you use to copy a mask with Property Links. I'm not much of a scripting guy, but I think you need to include something like this:

 

comp("Pre-comp 2").layer("Layer with the Mask").mask("Mask 1").maskPath