Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
appie21
Posts: 11
Joined: Tue Jul 27, 2010 2:12 am

Re: Addding an effect to a layer

Mon Aug 09, 2010 3:52 pm

You mean this

//start
var my_file = new File("d:/1.aep");
new_project = app.open(my_file);myComp = app.project.activeItem;
mySolid = myComp.layers.addSolid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.adjustmentLayer = true;
var myEffect = [b]mySollid[/b].property("Effects").addProperty("Fast Blur");
myEffect.property("Blurriness").setValue(17);
var myQueue = app.project.renderQueue
myQueue.render();
var projectName = "Unsaved Project";
app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES)
//end


ok the code work now
but i want to add he effect direct to the images (not add a solid)

Maybe i must change my question "how can i add a effect to a image!"
because i have tree or more images in my timeline and I only will add the fast blur to some images (for exampleat #1 and no #3 in the time line)
not add the effect to all images in my time line
(if I add the solid all the images get that Fast Blur)

Hope I have understand it more clearly!
But for now realy thanks!
 
Dan Ebberts
Posts: 318
Joined: Sat Jun 26, 2004 10:01 am
Location: Folsom, CA
Contact:

Re: Addding an effect to a layer

Mon Aug 09, 2010 4:24 pm

OK, like this then (substitute in the name of the image layer)

var myLayer = myComp.layer("name of your image layer goes here");
var myEffect = myLayer.property("Effects").addProperty("ADBE Fast Blur");
myEffect.property("ADBE Fast Blur-0001").setValue(17);



Dan
 
appie21
Posts: 11
Joined: Tue Jul 27, 2010 2:12 am

Re: Addding an effect to a layer

Mon Aug 09, 2010 4:39 pm

Dan Ebberts wrote:
OK, like this then (substitute in the name of the image layer)

var myLayer = myComp.layer("name of your image layer goes here");
var myEffect = myLayer.property("Effects").addProperty("ADBE Fast Blur");
myEffect.property("ADBE Fast Blur-0001").setValue(17);



Dan

WowThanks I will try tommorow! i must go sleep first! 1:37 AM here
but must i give the image name a ful path for example d:\spot1.jpg or is spot1.jpg enough (same as the name on the timeline)

Good day an Thank you!


hehe

i ca'n't wait tomorrow so i have try

var myLayer = myComp.layer("1.bmp");
var myEffect = myLayer.property("Effects").addProperty("Fast Blur");
myEffect.property("Fast Blur").setValue(17);

var myQueue = app.project.renderQueue
myQueue.render();
var projectName = "Unsaved Project";
app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES)
//end


it runs not
myEffect.property("Fast Blur").setValue(17);

say Null is not an object!

i feel we are near close

I run again and I get another error
var myLayer = myComp.layer("1.bmp");
object is invailid

i have put it on the timeline?

I need a little help!

Thanks again!
 
appie21
Posts: 11
Joined: Tue Jul 27, 2010 2:12 am

Re: Addding an effect to a layer

Tue Aug 10, 2010 3:42 am

Dan!
It works! so thanks!
 
appie21
Posts: 11
Joined: Tue Jul 27, 2010 2:12 am

Re: Addding an effect to a layer

Tue Aug 10, 2010 2:01 pm

Here i am again

I have now add a adjustmentlayer in my project (manual it is already placed there)
I have a code that ADD a (new)solid

mySolid = myComp.layers.Solid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.adjustmentLayer = true;
myEffect = mySolid.property("Effects").addProperty("Fast Blur")("Blurriness").setValue(61);


This code add a new solid how can i put the effect on my already placed adjustment layer in the time line?

and if i have more adjustment layers on the time line how can i add the effect to some of them?


So question again how to add a effect to Adjusmentlayer in the timeline!
let me know!
 
appie21
Posts: 11
Joined: Tue Jul 27, 2010 2:12 am

Re: Addding an effect to a layer

Thu Aug 12, 2010 6:21 am

appie21 wrote:
Here i am again

I have now add a adjustmentlayer in my project (manual it is already placed there)
I have a code that ADD a (new)solid

mySolid = myComp.layers.Solid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.adjustmentLayer = true;
myEffect = mySolid.property("Effects").addProperty("Fast Blur")("Blurriness").setValue(61);


This code add a new solid how can i put the effect on my already placed adjustment layer in the time line?

and if i have more adjustment layers on the time line how can i add the effect to some of them?


So question again how to add a effect to Adjusmentlayer in the timeline!
let me know!


Can Someone Help (or is my English too bad ;( please let me know!
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Re: Addding an effect to a layer

Thu Aug 12, 2010 8:16 am

It is hard to understand what you're trying to do. It would be helpful if you could start again and explain exactly what you want the script to do.

Here's an example that shows a couple of ways of adding effects to layers in the currently selected comp:
{
   var theLayer, theEffect;
   
   var activeItem = app.project.activeItem;   // find currently selected comp
   if (activeItem != null && activeItem instanceof CompItem) {
         
      // ADD EFFECT TO ALL LAYERS      
      for (var i =1; i <= activeItem.layers.length; i++) {  // loop through all layers in the comp
         theLayer = activeItem.layer(i);            
         theEffect = theLayer.property("Effects").addProperty("ADBE Fast Blur");      // add effect to layer
         theEffect.property("ADBE Fast Blur-0001").setValue(17);   // set effect value
      }
   
      // ADD EFFECT TO SELECTED LAYERS
      for (i = 0; i < activeItem.selectedLayers.length; i++) {    // loop through selected layers in the comp
         theLayer = activeItem.selectedLayers[i];
         theEffect = theLayer.property("Effects").addProperty("ADBE Fast Blur");      // add effect to layer
         theEffect.property("ADBE Fast Blur-0001").setValue(25);   // set effect value
      }
   }
}
      
 
paylituzu
Posts: 6
Joined: Mon Jul 03, 2017 12:04 am

Re: Addding an effect to a layer

Mon Jul 03, 2017 12:08 am

 
  1. Select a single layer from the Layers panel.
  2. Do one of the following: Double-click the layer, outside the layer name or thumbnail. ...
  3. Set effect options in the Layer Style dialog box. See Layer style options.
  4. Add other effects to the style, if desired.
[color=#FFFFFF]goldenslot[/color]
[color=#FFFFFF]GCLUB มือถือ[/color]

Who is online

Users browsing this forum: No registered users and 2 guests