FORUMS: list search recent posts

How to set a layers scale property within a sliders expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Caspar Wiegel
How to set a layers scale property within a sliders expression
on Nov 16, 2010 at 10:00:46 pm

Hi,

What I'm trying to achieve is a slider control that I can save as a preset and within the expression that is attached to the slider value I want to set the horizontal scale property of the layer the slider is applied to, and leave the vertical scale property as default 100.

I've been looking at something like the following but it won't work:

temp = effect("Slider Control")("Slider");
thisLayer.transform.scale(temp, 100);

Any clues as to what I am doing wrong?

Thanks a lot!


Return to posts index

Kevin Camp
Re: How to set a layers scale property within a sliders expression
on Nov 16, 2010 at 10:42:45 pm

you were close...

the last line just need to be the value that you want for the property, you don't need to specify the property. and since this value is an array, it will need to be in brackets.

so this is all you should need:

temp = effect("Slider Control")("Slider");
[temp, 100]


Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Dan Ebberts
Re: How to set a layers scale property within a sliders expression
on Nov 16, 2010 at 10:52:11 pm

Also, your question implies that you want the expression to be on the slider, but that won't work. The expression needs to go on the scale property.

Dan



Return to posts index


Caspar Wiegel
Re: How to set a layers scale property within a sliders expression
on Nov 17, 2010 at 7:27:29 am

Hi Guys,

Both thanks for your contribution, but the whole idea was that what Dan says to be impossible... Which is a pity! I just wanted to make a preset which I can drag and drop on any given layer and that that preset adjusts the scale and position of the applied layer.

Thanks again for the replies.

Caspar


Return to posts index

Dan Ebberts
Re: How to set a layers scale property within a sliders expression
on Nov 17, 2010 at 8:06:48 am

I didn't mean that it was impossible. It's just that the expression has to be on the scale property. After you create the expression, you just need to select both the slider and the scale property before you save your preset so that they're both included.

Dan



Return to posts index

Caspar Wiegel
Re: How to set a layers scale property within a sliders expression
on Nov 17, 2010 at 6:09:20 pm

Great!

I don't see the logic in this, but it works perfectly fine :).

Thanks again! Cheers!


Return to posts index


Kevin Camp
Re: How to set a layers scale property within a sliders expression
on Nov 17, 2010 at 6:26:37 pm

in ae, it's like the parent doesn't tell the child what to do, the child just follows the parent...

so one property can't set another property directly, but you can set a property to look at another for data. so you set the scale property to look at the slider property for data.

then when creating a preset, you just need to make sure you select all properties that you want contained in the preset... so you could have position, rotation, effect properties, etc. all contained in one preset.

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

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