Addding an effect to a layer

Find out why the . goes before the /

Moderator: Paul Tuersley

appie21
Posts: 11
Joined: July 27th, 2010, 2:12 am

You mean this

Code: Select all

//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: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

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: July 27th, 2010, 2:12 am

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

Code: Select all

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: July 27th, 2010, 2:12 am

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

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

Code: Select all

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: July 27th, 2010, 2:12 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

Code: Select all

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: June 5th, 2004, 7:59 am
Location: London, UK

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:

Code: Select all

{
	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
		}
	}
}
		
Post Reply