Copy link to clipboard
Copied
In this simple script, I'm adding a Gaussian blur to a layer with a value of 1. But my question is, can you add an effect to a layer but hide the effect controls via scripting? Eventually, I would map the controls to a custom slider or UI, but before I got that deep into things, I was curious if it's even possible to hide effect(s) in the Effects Control Panel.
Here's the simple code that I have:
// Apply Gaussian Blur effect with a value of 1 to selected layers
// Get the active composition
var comp = app.project.activeItem;
// Check if the active item is a composition
if (comp instanceof CompItem) {
// Get the selected layers
var selectedLayers = comp.selectedLayers;
// Loop through the selected layers
for (var i = 0; i < selectedLayers.length; i++) {
var layer = selectedLayers[i];
// Create a new Gaussian Blur effect
var gaussianBlur = layer.Effects.addProperty("ADBE Gaussian Blur 2");
// Set the blurriness value to 1
gaussianBlur.property("Blurriness").setValue(1);
}
} else {
alert("Please select a composition.");
}
Thank you!
Copy link to clipboard
Copied
I'm not aware of any way to do that.
Copy link to clipboard
Copied
Thanks for the reply, Dan. I am a big fan of your work!
I guess mapping the controls to custom sliders via a script is the way to go. I'm working toward building a small suite of tools that I use all the time in comp.
-Josh Johnson
Copy link to clipboard
Copied
I don't know if it's of any use to you, but I believe that some of the pseudo effect controls have an "invisible" attribute that you can use to hide the controls.
Copy link to clipboard
Copied
Thank you. I will look into this.
Copy link to clipboard
Copied
I guess what you could do is select nothing but the effect and simulate a left arrow keystroke. This will collapse the effect (but the action will be visible to the user as it's happening in realtime). Here's how you can simulate a keystroke: https://community.adobe.com/t5/after-effects-discussions/save-an-animation-preset-with-a-script-and-...
Copy link to clipboard
Copied
Thank you! I will check that out.