Last active
April 27, 2016 14:01
-
-
Save dokluch/39c0f6040ee6c7442cbe5bf4f5addca7 to your computer and use it in GitHub Desktop.
Убирает вообще все паренты в проекте
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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