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
// Premiere Pro CC2018 and later | |
for (var selection, viewIDs = app.getProjectViewIDs(), i = 0; i < viewIDs.length; i++) | |
if (app.getProjectFromViewID(viewIDs[i]).name == app.project.name) { | |
selection = app.getProjectViewSelection(viewIDs[i]); | |
break | |
} | |
for (i = 0; i < selection.length;i++){ | |
var item = selection[i]; | |
item.videoComponents[0].properties[25].setValue(1); // set to REDgamma3 | |
// item.videoComponents[0].properties[25].setValue(4); // set to REDlogFilm |
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
var sequence = app.project.activeSequence, trackGroups = [sequence.audioTracks, sequence.videoTracks], items = []; | |
for (i = 0; i < trackGroups.length; i++) { | |
var trackCount = trackGroups[i].numTracks; | |
for (j = 0; j < trackCount; j++) { | |
var clipCount = trackGroups[i][j].clips.numItems; | |
for (k = 0; k < clipCount; k++) | |
trackGroups[i][j].clips[k].setSelected(!1 === trackGroups[i][j].clips[k].isSelected()); | |
} | |
} |
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); |
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
// Inverts selected layers in the Active Comp | |
var active = app.project.activeItem; | |
if (active && active instanceof CompItem) { | |
var layerLen = active.layers.length; | |
for (var i = 1; i < layerLen + 1; i++) | |
active.layers[i].selected = active.layers[i].selected === false; | |
} |
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
// Selects all Unparented Layers | |
var layers = app.project.activeItem.layers; | |
var num = app.project.activeItem.layers.length; | |
for(var i = 0; i < num;i++){ | |
var layer = layers[i+1]; | |
layer.parent === null ? layer.selected = true: null; | |
} |
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
// Sets colorspace of selected footage to REDLogFilm | |
for (var selection, viewIDs = app.getProjectViewIDs(), i = 0; i < viewIDs.length; i++) | |
if (app.getProjectFromViewID(viewIDs[i]).name == app.project.name) { | |
selection = app.getProjectViewSelection(viewIDs[i]); | |
break | |
} | |
for (i = 0; i < selection.length;i++){ | |
var item = selection[i]; | |
// item.videoComponents[0].properties[25].setValue(1); // set to REDgamma3 |
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
// Apply Warp Stabilizer to first layer in all selected comps | |
for (i = 0; i < app.project.selection.length; i++) { | |
app.project.selection[i].layers[1].Effects.addProperty('Warp Stabilizer'); | |
} |
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 the parent bin of a project item | |
// Example: getParentBin(app.project.activeSequence.projectItem, app.project.rootItem) | |
function getParentBin(item, base){ | |
var path = item.treePath; | |
for(var i = 0; i < base.children.numItems; i++){ | |
if(base.children[i].type == ProjectItemType.BIN){ | |
var foundItem = getParent(item, base.children[i]); | |
if(foundItem){ | |
return foundItem; |
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); |
OlderNewer