ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change property of the effect Set Matte2 by scripting

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Baptiste Rieu
Change property of the effect Set Matte2 by scripting
on Mar 7, 2017 at 7:00:06 pm

Hi everyone, I just need a little help.

On my script, I create a text then i want to hide it.

So i put the Set Matte Effect, but i don't know how to change the properties.

Her is my code :

cache =MyComp.property("Effects").addProperty("ADBE Set Matte2");
MyComp.property("Effects").property("ADBE Set Matte2")("Invert Matte").setValue(1);

Thanks a lot, and sorry for my english !

cache =MyComp.property("Effects").addProperty("ADBE Set Matte2");
MyComp.property("Effects").property("ADBE Set Matte2")("Invert Matte").setValue(1);


Return to posts index

Xavier Gomez
Re: Change property of the effect Set Matte2 by scripting
on Mar 9, 2017 at 9:47:43 am

What you have tried works for me, and so do any of these:

var cache = myLayer.effect.addProperty("ADBE Set Matte2");

cache.property("Invert Matte").setValue(1);
cache.property(3).setValue(1);
cache.property("ADBE Set Matte2-0003").setValue(1);

you can access the matchName of a property like this:
cache.property(1).matchName; // gives "ADBE Set Matte2-0001"

Xavier


Return to posts index

Baptiste Rieu
Re: Change property of the effect Set Matte2 by scripting
on Mar 9, 2017 at 1:14:32 pm

Thank you very much, i didn't knew this method.

A second question if it' not too much 😉

If I want to change the layer used for the matte (2nd property). I tried with giving the layer index put it didn't work. Should it have ?


Return to posts index


Xavier Gomez
Re: Change property of the effect Set Matte2 by scripting
on Mar 9, 2017 at 1:59:23 pm

Normally it should work. Maybe check your syntax.
I just tried and it worked for me:

var comp = app.project.activeItem;
var mattefx = comp.layer(1).effect(1);
var matteLayer = comp.layer("Matte");
fx(1).setValue(matteLayer.index);

(setting a value of 0 will set the matte to "None").

Xavier


Return to posts index

Baptiste Rieu
Re: Change property of the effect Set Matte2 by scripting
on Mar 9, 2017 at 2:03:00 pm

Perfect ! Thank you again !


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]