Activity › Forums › Adobe After Effects › update all label colors
-
update all label colors
Posted by Kabo Lam on January 2, 2023 at 11:45 amHi all,
is there anyway to change the color label of compositions in the project panel which then will update the color in in every nested comp?
for example: if comp_01 is used in 6 different compositions and I updated the color label to purple in the project panel, it pushes this change in all the 6 compositions I used this comp_01 as well to purple.
Max Haller replied 3 years, 3 months ago 6 Members · 8 Replies -
8 Replies
-
Graham Quince
January 3, 2023 at 8:34 pmI imagine you’d need a script for that. As far as I know it’s not built-in.
-
Walter Soyka
January 3, 2023 at 9:43 pmThis challenge is actually really similar to another nearby post about guide layers [link], so I’ve modified the script I wrote for that a little bit.
Save the block of text below as a JSX file, and install in your scripts folder.
Select the items(s) with the label color that you want to push through the project in the project panel, and run this script.
// keen-PushItemLabelsToLayers.jsx
// this script takes the the project selection, searches each comp for layers sourced from those item(s), and sets their layer label color to match
var selectedItems = app.project.selection.length > 0 ? app.project.selection : null;
if (selectedItems != null) {
// we always set an undo to be nice to our users
app.beginUndoGroup("Push item labels to layers");
// we'll want to track what we do so we can report back to our users
var setLayerLabelCount = 0;
var affectedCompList = [];
// for each item selected in the project panel...
for (var selectedItemsIndex = 0; selectedItemsIndex < selectedItems.length; selectedItemsIndex++) {
currentItem = selectedItems[selectedItemsIndex];
// we'll step through every comp in the project...
for (var projectItemIndex = 1; projectItemIndex <= app.project.numItems; projectItemIndex++) {
if (app.project.item(projectItemIndex) instanceof CompItem) {
var currentComp = app.project.item(projectItemIndex);
// and look at every layer to see if they match our selected source layer
for (var compLayerIndex = 1; compLayerIndex <= currentComp.numLayers; compLayerIndex++) {
var currentLayer = currentComp.layer(compLayerIndex);
// and for any layers that do match but have a different label color, change their label
// also increment the guide layer count, and push the comp onto the list of affected comps
if ( (currentLayer.source == currentItem) && (currentLayer.label != currentItem.label) ) {
currentLayer.label = currentItem.label;
setLayerLabelCount++;
affectedCompList.push(currentComp);
}
}
}
}
}
// remove duplicate comps from our list of affected comps
for (var compListIndex = affectedCompList.length; compListIndex > 0; compListIndex--) {
if (affectedCompList[compListIndex] == affectedCompList[compListIndex-1]) {
affectedCompList.splice(compListIndex, 1);
}
}
// summarize the changes in the Info panel
writeLn("Changed " + setLayerLabelCount + " label layer color" + (setLayerLabelCount == 1 ? "" : "s") + " in " + affectedCompList.length + " comp" + (affectedCompList.length == 1 ? "" : "s") + ".");
// that's all, folks. wrap up the undo
app.endUndoGroup();
} else {
alert("No items selected. This script search each comp in the project for layers from the first selected project item and matches their layer label colors to the item label colors.");
} -
Kabo Lam
January 4, 2023 at 9:42 amAh, thats amazing Walter,
I tried the script and this is EXACTLY what i mean, thank you! Sometimes you only see what precomps needs to be highlighted halfway through the work you have already done, and its a pain to go throught all the comps to change the colors.
-
Dan Peck
January 10, 2023 at 5:41 pmIs there a way to link the colour of the Comps in the project panel to already submitted render queue items for those comps.
Natively it takes the colour when you submit the comp to the render queue, but if you change the comp colour after you have to manually colour the render output as well if you want it to match
-
Dan Ebberts
January 10, 2023 at 8:20 pmAs far as I know, labels for render queue items aren’t accessible to scripting, and I don’t know how else you would do it.
-
Dan Peck
January 10, 2023 at 8:28 pmThanks Dan I did wonder if this was even achievable. Another wish list item prehaps
-
Walter Soyka
January 10, 2023 at 8:33 pmAs Dan said, scripts can’t access render queue item labels, and this does strike me as a curious omission. I’ll put in a feature request.
-
Max Haller
January 19, 2023 at 7:13 pmBrilliant. Filing this under something i never knew i needed!
Reply to this Discussion! Login or Sign Up