Scripts for After Effects

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2013   #1
Scripts for After Effects

Hi everyone,

I try to create a little script for After Effects for create a "macro" inside my comp.

My project - I have more layer and I need to apply the "layer style" with particular property to all. I could use "copy and paste" but the problem is I should apply the same effects/style to another (=more) file.

So... I found the solution for Effects bacause I use the preset, but for Layer Style I try with this script (i found it here: http://forums.creativecow.net/readpost/227/21546)


Code:
{ var myCompName = "Comp 1"; var myComp = null; for (var i = 1; i <= app.project.numItems; i++){ if (app.project.item(i).name == myCompName && app.project.item(i) instanceof CompItem){ myComp = app.project.item(i); } } if (myComp){ myComp.openInViewer(); myComp.layer(1).selected = true; app.executeCommand(app.findMenuCommandId("Color Overlay")); } }


My goal add more layer style and apply some property in automatic so I change



Code:
{ var myCompName = "Comp"; //give name of your composition var myComp = null; for (var i = 1; i <= app.project.numItems; i++){ if (app.project.item(i).name == myCompName && app.project.item(i) instanceof CompItem){ myComp = app.project.item(i); } } if (myComp){ myComp.layer(1).selected = true; app.executeCommand(app.findMenuCommandId("Drop Shadow")); } if (myComp){ myComp.layer(1).selected = true; app.executeCommand(app.findMenuCommandId("Outer Glow")); } }


I try to add the color of Drop Shadow, I based on another string with:


based/reference string

Code:
//This will change the opacity of the inner shadow on a layer with inner shadow turned on already var layer_1 = test_comp.layer(1) layer_1.property("Layer Styles").property("Inner Shadow")("Opacity").setValue(10)


My string

Code:
//This will change the opacity of the inner shadow on a layer with inner shadow turned on already var layer_1 = test_comp.layer(1) layer_1.property("Layer Styles").property("Inner Shadow")("Color")=([58,168,204]);


But don't work... I try with more different string but I don't find the solution


I will try to change this different value:

layerStyle.dropShadow.color
layerStyle.dropShadow.opacity
layerStyle.dropShadow.angle
layerStyle.dropShadow.spread
layerStyle.dropShadow.size

From expression I think to work on it with the "setValue()"

Code:
layerStyle.dropShadow.color('#3AA8CC'); layerStyle.dropShadow.opacity.setValue(100); layerStyle.dropShadow.angle.setValue(+45); layerStyle.dropShadow.spread.setValue(67); layerStyle.dropShadow.size.setvalue(3);


Some one can help me? or can give me a link for solution about it?

thank you for your time and I hope some people can understand my english.

Matteo
__________________

VFX | CG Artist
available for freelance jobs
www.art2upz.com

RnD | Simulation Reel July 2014
3D Generalist Reel Winter 2012
 
Old 06 June 2013   #2
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:43 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.