• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Mar 23, 2024 Mar 23, 2024

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!

TOPICS
Scripting

Views

306

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2024 Mar 23, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2024 Mar 23, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2024 Mar 23, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2024 Mar 23, 2024

Copy link to clipboard

Copied

Thank you. I will look into this. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 23, 2024 Mar 23, 2024

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-...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2024 Mar 23, 2024

Copy link to clipboard

Copied

LATEST

Thank you! I will check that out.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines