Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change scale property of a layer using expressions in an expression control

New Here ,
Nov 04, 2016 Nov 04, 2016

I would like to change the scale property of a layer, using an expression control effect applied on it. So basically, I don't want to apply the expression directly on the scale property. I want to apply it on a separate place so that I can easily copy paste the scaling effect on to other layers, without having to individually click on to the scale property of these layers.

So far, I know that I can access the layer property using:

thisLayer.transform.scale[1];

However, when I use:

thisLayer.transform.scale = [50,50];

nothing happens.

Can someone please help me. I just want to change the layer's scale property, by applying the expression in the effects area.

Thanks in advance!

13.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2016 Nov 04, 2016
LATEST

You need to spend a little time with expression basics. Type expressions in the Search Help field at the top right corner of AE and study up. You will be amazed what a half hour can do for your understanding.

You have a few options. If you want equal scale values for all parameters you can create a null layer and add an expression slider to the null. Now lock the Expression Control Panel so the effects stay visible.

Now you open one of the layers that you want to control and start an expression by clicking the stopwatch while holding down the Alt/Option key.

Now you type "s =" and then drag the slider to the Expression Control Panel and tag the slider and release.

If you have not renamed anything the expression would look like this so far:

s = thisComp.layer("Null 1").effect("Slider Control")("Slider");

now just add the array:

[s, s]

Now that the expression is created select the scale property and go to the edit menu and select copy expression only.

Now select all the layers you want to control and paste (Ctrl/Cmnd + v) and you're done.

Screen Shot 2016-11-04 at 3.45.36 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines