Skip to content

Instantly share code, notes, and snippets.

@dokluch
Last active April 27, 2016 14:01
Show Gist options
  • Save dokluch/39c0f6040ee6c7442cbe5bf4f5addca7 to your computer and use it in GitHub Desktop.
Save dokluch/39c0f6040ee6c7442cbe5bf4f5addca7 to your computer and use it in GitHub Desktop.
Убирает вообще все паренты в проекте
for(var i = 1; i < app.project.items.length; i++){
app.beginUndoGroup("Unparent All");
if(app.project.items[i] instanceof CompItem){
unParentComp(app.project.items[i])
}
app.endUndoGroup();
}
function unParentComp(_comp){
//эта функция пройдется по всем слоям композиции и уберет все паренты
for(var l = 1; l <= _comp.layers.length; l++){
thisLayer = _comp.layers[l];
if(thisLayer.parent) thisLayer.parent = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment