Skip to main content
joshjvfx
Participant
Mar 23, 2024 5:07 PM UTC
Question

Scripting Question: Is it possible to Add an effect to a layer but Hide it's control properties?

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!

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

ConstantinMaier
Inspiring
Mar 23, 2024 8:01 PM UTC

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-then-customize-the-file-explorer-it-opened/m-p/12589239#M188663

Translate
joshjvfx
joshjvfxAuthor
Participant
Mar 24, 2024 4:16 AM UTC

Thank you! I will check that out.

Translate
Dan Ebberts
Community Expert
Community Expert
Mar 23, 2024 5:44 PM UTC

I'm not aware of any way to do that.

Translate
joshjvfx
joshjvfxAuthor
Participant
Mar 23, 2024 6:01 PM UTC

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

Translate
Dan Ebberts
Community Expert
Community Expert
Mar 23, 2024 6:35 PM UTC

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.

Translate