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
// Gets all properties with keyframes in a layer | |
function getPropsWithKeys(layer) { | |
var numRootProps = layer.numProperties; | |
var propsWithKeys = []; | |
for (var i = 0; i < numRootProps; i++) { | |
var prop = layer(i + 1); | |
var isGroup = prop.numProperties && prop.numProperties > 0; | |
if (isGroup) { | |
for (var j = 0; j < prop.numProperties; j++) { | |
var subProp = prop.property(j + 1); |
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
// Resets All Position Values to 0 | |
app.beginUndoGroup('Reset 0'); | |
var selectedLayers = app.project.activeItem.selectedLayers; | |
for (var i = 0; i < selectedLayers.length; i++) { | |
var layer = selectedLayers[i]; | |
var is3D = layer.threeDLayer; | |
if(layer.transform.position.canSetExpression){ | |
layer.transform.position.setValue([0,0,0]); | |
}else{ | |
layer.transform.xPosition.setValue(0); |
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
// Resets Position, Scale, and Rotation on selected 2D or 3D Layers | |
app.beginUndoGroup('Reset PSR'); | |
var selectedLayers = app.project.activeItem.selectedLayers; | |
for (var i = 0; i < selectedLayers.length; i++) { | |
var layer = selectedLayers[i]; | |
var center = [Math.round(app.project.activeItem.width / 2), Math.round(app.project.activeItem.height / 2), 0] | |
var is3D = layer.threeDLayer; | |
if(layer.transform.position.canSetExpression){ | |
layer.transform.position.setValue(center); |