ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Add expression to selection of properties

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Pascal Miller
Add expression to selection of properties
on Jan 23, 2018 at 10:16:17 pm

Hello,
I'm trying to write a script that will add the posterizeTime(); effect and add it to all selected properties. If a given property does not have an expression (say it only has keys), it will create the expression, and if there is an existing expression already there, it will add the posterizetime at the top of the expression (to preserve the existing expression)

Is this hard?

Thanks in advance!
Pascal


Return to posts index

Andrei Popa
Re: Add expression to selection of properties
on Jan 25, 2018 at 10:28:08 pm

This should not be so hard. Should look like thisif (layerProperty.expression == ''){ //the layer does not have an expression
layerProperty.expression = yourExpression;
}else{ //the layer already has an expression
expr = layerProperty.expression;
layerProperty.expression = yourExpression +'\n'+expr;
}


layerProperty should be the property you choose and yourExpression should be the expression you use. The '\n' is used there as an empty line.

Andrei
My Envato portfolio.


Return to posts index

Pascal Miller
Re: Add expression to selection of properties
on Jan 28, 2018 at 1:53:53 am

Excellent thank you so much!!

Pascal


Return to posts index

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