Skip to content

Commit

Permalink
Add 'Select Orphan Layers'
Browse files Browse the repository at this point in the history
  • Loading branch information
zlovatt committed Jun 15, 2022
1 parent ae21b0f commit bf281d4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Select Orphan Layers.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Selects unparented layers in current comp
*
* @author Zack Lovatt <[email protected]>
* @version 0.1.0
*/
(function selectOrphanLayers() {
var comp = app.project.activeItem;

if (!(comp && comp instanceof CompItem)) {
alert("Open a comp!", "Select Orphan Layers");
return;
}

for (var ii = 1, il = comp.numLayers; ii <= il; ii++) {
var layer = comp.layer(ii);

// Deselect all layers
layer.selected = false;

// Skip locked or parented layers
if (layer.locked || layer.parent) {
continue;
}

layer.selected = true;
}
})();
19 changes: 19 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,25 @@ Selects all layers in your comp that start after the selected layer.

---

<div>
<div>
<div>
<div>

#### [Select Orphan Layers](https://raw.githubusercontent.com/zlovatt/zl_Scriptlets/master/Select&#32;Orphan&#32;Layers.jsx)

</div>
<div>

Selects unparented layers in current comp.

</div>
</div>
</div>
</div>

---

<div>
<div>
<div>
Expand Down

0 comments on commit bf281d4

Please sign in to comment.