Skip to main content
Participant
January 23, 2020
Answered

Control Scale and Position with Dropdown Menu

  • January 23, 2020
  • 1 reply
  • 1509 views

Hello everybody,

 

I'm looking for help.

Basically, I want to create a Dropdown Menu to pick either there are 1, 2 or 3 images showing up on screen depending on the selection on the new Dropdown Menu parameter.

 

I used a basic if else expression for opacity, which worked fine.

The thing is, if there is only 1 image on screen, I want it to be bigger, so I created an expression on the Transform Scale property, but it seems more complicated than I expected.

 

I tried using the following expression :

if ( thisComp.layer("Nul 1").effect("Dropdown Menu Control")("Menu") == 1 )

{ 100,100 }

else { 67,67 }

The returned error is "expression result must be of dimension 2, not 1, error occured at line 0, expression disabled." on line 1.

 

Do you guys have any idea ?

Maybe I got the scale value format wrong ? And what is the format I could use for position ?

This topic has been closed for replies.
Correct answer Rick Gerard

Arrays are enclosed in square brackets, not curly brackets. Try this:

 

if(thisComp.layer("Null 1").effect("Dropdown Menu Control")("Menu")==1)
	[100, 100]
else
	[67, 67]

 

1 reply

Rick GerardCommunity ExpertCorrect answer
Community Expert
January 23, 2020

Arrays are enclosed in square brackets, not curly brackets. Try this:

 

if(thisComp.layer("Null 1").effect("Dropdown Menu Control")("Menu")==1)
	[100, 100]
else
	[67, 67]

 

Participant
January 24, 2020

It worked !

I managed to make it work yesterday by using a second null object storing the values, but this is way better !

I guess I'm still clumsy with expressions !

Thanks a lot !