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

extendscript after effects: is there a way to create a simple module to apply effects

Explorer ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

is there a way I can simplify my work by creating an add effect module rather than creating line-by-line code for each effect like this?

 

1: i want to create a module and call it from button click

somefunction(effect name),selected layer

somefunction(BCC Temporal Blur)selected layer

 

rather than creating big lines of codes under button click below

 

currently, i have code like this to apply or add

myComp = app.project.activeItem;
mySolid = myComp.layers.addSolid([0,.8,.4], "BG", myComp.width, myComp.height,1);
mySolid.startTime = 0

myEffect = mySolid.property("Effects").addProperty("Power Stroke");
app.endUndoGroup();

apply effect on the selected layer

var myComp = app.project.activeItem;
var preCompLayer = myComp.selectedLayers[0];
preCompLayer.property("Effects").addProperty("BCC Velocity Remap");

 

TOPICS
Expressions , Scripting

Views

154

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
Explorer ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

maybe you can help fix this?

function applyfxx(fxx,selected layer) { 
var myComp = app.project.activeItem;
var preCompLayer = myComp.selectedLayers[0];
preCompLayer.property("Effects").addProperty(fxx);
}

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
Explorer ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

function applyfxx(fxx) { 
var myComp = app.project.activeItem;
var preCompLayer = myComp.selectedLayers[0];
preCompLayer.property("Effects").addProperty(fxx);
}

applyfxx("VC Orb");

is this better can it be more better maybe call applyfxx from button click this way it shortens codes accross the project

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
Explorer ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

function applyfxx(fxx) { 
    var myComp = app.project.activeItem;
    	  var curItem = app.project.activeItem;
	  var selectedLayers = curItem.selectedLayers;
	  var selectedProperties = app.project.activeItem.selectedProperties;
var preCompLayer = myComp.selectedLayers[0];
      if (selectedLayers == 0){
	    alert("Please Select at least one Layer");
        return;
        }

preCompLayer.property("Effects").addProperty(fxx);
}
// on selected layer

	
applyfxx("VC Orb");

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 ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

Not sure what exactly you want to improve here.

If you look for a very efficient and fast way to create these kinds of these "a little bit more than a basic preset in one click" tools, Automation Blocks is a great solution. Much faster than writing the code manually. See this tutorial series for an example:

Tutorial Highlight Tools

 

Automation Blocks is currently available as free, public beta until end of July.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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
Explorer ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

LATEST

thanks for the suggestion mathias but am building a script for public and my self and i just needed support buddy with the code i have.

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