Skip to content

Instantly share code, notes, and snippets.

@aescripts
Last active August 20, 2022 06:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aescripts/d3600be6ba22cb53138a4477684998e4 to your computer and use it in GitHub Desktop.
Save aescripts/d3600be6ba22cb53138a4477684998e4 to your computer and use it in GitHub Desktop.
#AfterEffects #Script #KBar #AutoTrace Auto Traces and copies the masks from the layer above
/*
AutoTrace and copy Masks from Layer Above.jsx
By Lloyd Alvarez https://aescripts.com/
Selects the layer above
Invokes Auto-Trace...
Copies the masks to the layer below
Deletes the layer above
*/
try{
app.beginUndoGroup("Auto-trace and copy masks from Layer Above");
var myComp = app.project.activeItem;
var myLayer = myComp.selectedLayers[0];
var layerAbove = myComp.layer(myLayer.index-1);
layerAbove.selected = true;
myLayer.selected = false;
app.executeCommand(app.findMenuCommandId("Auto-trace..."));
for (var j=1; j<= layerAbove.property("Masks").numProperties; j++) { //loop through the parent properties
if (layerAbove.property("Masks").property(j).hasOwnProperty("Mask Path")) {
var myPath = layerAbove.property("Masks").property(j).property("Mask Path");
var myShape = myPath.value;
var myNewMask = myLayer.property("Masks").addProperty("Mask");
var myNewPath = myNewMask.property("Mask Path");
myNewPath.setValue(myShape);
}
}
layerAbove.remove();
app.endUndoGroup();
}
catch (e) {
alert(e.toString());
}
@pixelfactorydevelopmentteam

Thank you very much for your help:)

Is it Possible to not have this message?

bd7609593822d9a93685883056485a

@onjackstalbeck
Copy link

Thank you very much for your help:)

Is it Possible to not have this message?

bd7609593822d9a93685883056485a

Its not :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment