PDA

View Full Version : AE Scripting: Adding two effects with the same name?!


ndeboar
05-30-2005, 02:18 AM
Hey,

I've just found somthing really annoying with AE scripting. I'm trying to automate adding a ton effects to some layers.

myLayer[0]("Effects").addProperty("Gaussian Blur");
myLayer[0]("Effects").addProperty("Gaussian Blur");

Creates two Gaussian blur layers
Gassuian blur
Gassuian Blur 1
But there's no way i can find of controling any properties for the second blur:

myLayer[0]("Effects")("Gaussian Blur 1").blurriness.setValue(50);

Returns an error! I can control the first one, but not the second.

Is there a way i can rename the effects? Im i missing somthing really obvious here?

Cheers,

Nick Deboar
www.thepra.com.au

Mylenium
05-30-2005, 04:55 AM
Hey,

I've just found somthing really annoying with AE scripting. I'm trying to automate adding a ton effects to some layers.

myLayer[0]("Effects").addProperty("Gaussian Blur");
myLayer[0]("Effects").addProperty("Gaussian Blur");

Creates two Gaussian blur layers
Gassuian blur
Gassuian Blur 1
But there's no way i can find of controling any properties for the second blur:

myLayer[0]("Effects")("Gaussian Blur 1").blurriness.setValue(50);

Returns an error! I can control the first one, but not the second.

Is there a way i can rename the effects? Im i missing somthing really obvious here?

Cheers,

Nick Deboar
www.thepra.com.au (http://www.thepra.com.au)

I think you should check your approach. Wouldn't it be simpler to just create an effect preset and then apply it whenever needed? It might be a bit "too manual", but at least works. Other than that I think you need to use the internal plugin name (ADBE Gaussian Blur) and then you could give each effect a unique name using setValue and a string. dunno how it should be done, though. Never tried and I'm crap at scripts anyway. :)

Mylenium

ndeboar
05-30-2005, 05:50 AM
Hey,

Yes and no. I need to duplicate the layer a couple times and apply differnt effects to differnt layers. It also creates a set of master controls that controls the colour and radius of the effect. Ill look into your idea, is there an easy way of renaming effects?

Cheers,

Nick

Mylenium
05-30-2005, 06:11 AM
Hey,

Yes and no. I need to duplicate the layer a couple times and apply differnt effects to differnt layers. It also creates a set of master controls that controls the colour and radius of the effect. Ill look into your idea, is there an easy way of renaming effects?

Cheers,

Nick

I wouldn't know about that. As I said, I'm quite crap at scripts and only look into such matters on an as-needed-basis. Needless to say I haven't needed it yet. Another idea might be two actually have two scripts applying the effects - one script applies an effect (which is defined as a basic text list or third script containing all necessary definitions) and then after having applied its settings call the second script (which is basically identical but with a different name) which then in turn calls the first script again once it's finished and so on until you have all effects stacked in the way you need them. By having two dumb scripts you could force AE to do all the critical stuff and not worry about renaming effects and calling their parameters. The trick is simply to apply your itemCollection before calling the other script. The fourth and last script could then easily browse thru all layers created and apply your expression stuff.

Mylenium

CGTalk Moderation
05-30-2005, 06:11 AM
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.