Hi I am making a script that creates an adjustment layer in my comp. How do I add an effect to this layer with scripting?
Here is my script so far:
//start
myComp = app.project.activeItem;
mySolid = myComp.layers.addSolid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.startTime = 0
mySolid.adjustmentLayer = true;
//end
Thanks
Pete
Addding an effect to a layer
Moderator: Paul Tuersley
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
Something like this:
myEffect = mySolid.property("Effects").addProperty("ADBE Lens Flare");
Dan
myEffect = mySolid.property("Effects").addProperty("ADBE Lens Flare");
Dan
Here is another related question (sorry - I'm still new to AFX):
How do I access the properties of the just added effect?
Lets say I've added a "Fast Blur" Effect to a layer. Reading the Bluriness value works like this:
app.project.item(1).layer("whatever_0000.tga")("Effects")("Fast Blur")("Blurriness")
But how do I actually SET a value? If I try to add just " = 17" AFX tells me
"Error: Can’t appear on the left hand side of an assignment, because it is read-only"
So what is the correct notation to assign a value to an effect's property?
Thanks a lot!
Uli
How do I access the properties of the just added effect?
Lets say I've added a "Fast Blur" Effect to a layer. Reading the Bluriness value works like this:
app.project.item(1).layer("whatever_0000.tga")("Effects")("Fast Blur")("Blurriness")
But how do I actually SET a value? If I try to add just " = 17" AFX tells me
"Error: Can’t appear on the left hand side of an assignment, because it is read-only"
So what is the correct notation to assign a value to an effect's property?
Thanks a lot!
Uli
To set a value, use the setValue method.
For example for a value of 17 use:
If you want to add a keyframe at a specific time, use the setValueAtTime method.
For example, to create a keyframe of 17 at the time of 2 seconds use:
Koby.
For example for a value of 17 use:
Code: Select all
app.project.item(1).layer("whatever_0000.tga")("Effects")("Fast Blur")("Blurriness").setValue(17);
For example, to create a keyframe of 17 at the time of 2 seconds use:
Code: Select all
app.project.item(1).layer("whatever_0000.tga")("Effects")("Fast Blur")("Blurriness").setValueAtTime(2,17);
That simple - thanks a lot, Koby.
To prevent further basic questions, can you please tell me where I can find such information in some documentation.
The online scripting help is a big joke. There must be a simple index of all functions, methods, properties and some basic examples for things like I've asked.
Thanks again!
Uli
To prevent further basic questions, can you please tell me where I can find such information in some documentation.
The online scripting help is a big joke. There must be a simple index of all functions, methods, properties and some basic examples for things like I've asked.
Thanks again!
Uli
The best and a MUST documentation, is After Effects CS3 Scripting Guide:
http://www.adobe.com/products/aftereffe ... _guide.pdf
Koby.
http://www.adobe.com/products/aftereffe ... _guide.pdf
Koby.
Hello
When i Use
then i get a Error AE was unable to call Item layer ... what do i wrong?
i have in my composition a image called spot1.jpg
over this image i will get the fast blur, blurriness also 17!
Howe can i get that!
When i Use
Code: Select all
app.project.item(1).layer("spot1.jpg")("Effects")("Fast Blur")("Blurriness").setValue(17);
i have in my composition a image called spot1.jpg
over this image i will get the fast blur, blurriness also 17!
Howe can i get that!
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
My guess is that your comp may not be the first item (item(1)) in the project bin.
If you make sure the comp is selected you could use activeItem instead, like this:
var myComp = app.project.activeItem;
myComp.layer("spot1.jpg")("Effects")("Fast Blur")("Blurriness").setValue(17);
Dan
If you make sure the comp is selected you could use activeItem instead, like this:
var myComp = app.project.activeItem;
myComp.layer("spot1.jpg")("Effects")("Fast Blur")("Blurriness").setValue(17);
Dan
it didn't work
must i give the full path of the image? for example d:\spot1.jpg?
i wil get a script when i run it it must do:
after open it there are 10 images in my work area
each image must get the effect fast blurr and i wil give each Fast blur effect uits own value (changed manual in the script)
I have made this code and it work for one picture becauase it add a new sollid.
But how can i make that each image get the effect blur on it?
Let me know
Albert
must i give the full path of the image? for example d:\spot1.jpg?
i wil get a script when i run it it must do:
after open it there are 10 images in my work area
each image must get the effect fast blurr and i wil give each Fast blur effect uits own value (changed manual in the script)
I have made this code and it work for one picture becauase it add a new sollid.
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;
myEffect = mySolid.property("Effects").addProperty("Fast Blur")("Blurriness").setValue(61);
var myQueue = app.project.renderQueue
myQueue.render();
var projectName = "Unsaved Project";
app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES)
//end
Let me know
Albert
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
You have a lot of work left to do. You need to import your images (see ImportOptions() and importFile() in the scripting guide). You need to add each image to the comp and then add the effect. You need to add your comp to the render queue (app.project.renderQueue.items.add(comp). You may also need to set the render settings and output modules and the output file.
Dan
Dan
helloDan Ebberts wrote:You have a lot of work left to do. You need to import your images (see ImportOptions() and importFile() in the scripting guide). You need to add each image to the comp and then add the effect. You need to add your comp to the render queue (app.project.renderQueue.items.add(comp). You may also need to set the render settings and output modules and the output file.
Dan
i have already placed my images in the timeline so all is imported jet!
i only want to get the effect's on the images so that if i start the script it automaticly do!
app.project.item(1).layer("whatever_0000.tga")("Effects")("Fast Blur")("Blurriness").setValue(17);
give an error to my file?
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
This should work:
var myEffect = myLayer.property("Effects").addProperty("Fast Blur");
myEffect.property("Blurriness").setValue(17);
If you're using a foreign language version of AE, you may need to use the match names like this:
var myEffect = myLayer.property("Effects").addProperty("ADBE Fast Blur");
myEffect.property("ADBE Fast Blur-0001").setValue(17);
Dan
var myEffect = myLayer.property("Effects").addProperty("Fast Blur");
myEffect.property("Blurriness").setValue(17);
If you're using a foreign language version of AE, you may need to use the match names like this:
var myEffect = myLayer.property("Effects").addProperty("ADBE Fast Blur");
myEffect.property("ADBE Fast Blur-0001").setValue(17);
Dan
Code: Select all
Hi Thanks for helpDan Ebberts wrote:This should work:
var myEffect = myLayer.property("Effects").addProperty("Fast Blur");
myEffect.property("Blurriness").setValue(17);
If you're using a foreign language version of AE, you may need to use the match names like this:
var myEffect = myLayer.property("Effects").addProperty("ADBE Fast Blur");
myEffect.property("ADBE Fast Blur-0001").setValue(17);
Dan
i have try it
like 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 = myLayer.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
at line 7 i get " Mylayer is undefined"
how to fix
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
Try changing "myLayer" to "mySolid"
Dan
Dan