Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Disabled number used Dropdown

  • Disabled number used Dropdown

  • Esteban CV

    September 23, 2022 at 10:27 pm

    Hi there !

    I am reaching my expression knowledge limit for a project. :’)

    I have a master controller, which controls the transparency of my layers thanks to a drop-down menu.

    The layers represent numbers from 1 to 49.

    If I have another drop-down menu, is it possible thanks to an expression, to deactivate / delete the value chosen in the 1st drop-down so as not to have the same number displayed?

    Thank you very much in advance,



  • Dan Ebberts

    September 23, 2022 at 11:12 pm

    It would help to know more about how you have things set up now, and how you want the new dropdown to alter the behavior.

  • Esteban CV

    September 24, 2022 at 12:23 pm

    Thank you very much for your quick response!

    So it’s a confidential project, I could not put a capture but I will try to explain it as clearly as possible, but if necessary I could simulate the problem on another project.

  • Dan Ebberts

    September 24, 2022 at 4:39 pm

    OK. So trying to imagine what you’re trying to do, here’s simple example of two interacting dropdown menus on a layer named “Control”. The first is named “Transparency” and it controls a layer’s visibility, based on whether the layer’s index matches the current selection in the dropdown menu. However, the effect of the Transparency can be overridden by the “Disable” dropdown menu if Disable is set to its first entry (“On” in this example).

    T = thisComp.layer("Control").effect("Transparency")("Menu");
    D = thisComp.layer("Control").effect("Disable")("Menu");
    if (D != 1){
    T == index ? 100 : 0
  • Esteban CV

    September 25, 2022 at 12:29 am

    Thank you very much for your quick response!

    So it’s a confidential project, I could not put a capture but I will try to explain it as clearly as possible, but if necessary I could simulate the problem on another project.

    So, the project is for a random draw for a draw of 5 winning balls out of 49. I have an image sequence of animation 3D of my 49 balls without numbers, as well as 49 image sequences of my numbers (a sequence with all the numbers 1, the second with all the number 2, etc) and 49 image sequences of the masks by balls in order to be able to display all the numbers on my ball 1, the same on ball 2 etc.

    At the end of my animation, I have my 5 winning balls coming out, with numbers and a precise combination, and the rest of the 44 balls can be random.

    I made a composition for my winning 1 ball, with my 49 number sequence and a drop-down menu that controls the opacity of my layers to display the number I want on the ball.

    I have the same for ball 2, ball 3, 4 and 5. (The combination of the final draw)

    I would need a solution so that my other 44 balls have numbers (random for simplicity) but which does not duplicate itself, so as not to have the number 5 twice, for example, in the end my 49 balls have a single number .

    At the end, I have to provide my client with an after effect file without plugin or script in order to be able to change the information very quickly and simply because the draw of the 5 winning numbers and the broadcast of the film is very short.

    I don’t know if the drop-down menu solution is the correct method for the first 5 numbers.

    I hope I have been clear, and really sorry for the long post.

    Thanks a lot


  • Dan Ebberts

    September 25, 2022 at 12:40 am

    Hard to say exactly, without seeing the details, but here goes. The biggest issue is that all 44 non-winning balls have to have access to the same random information, which is tough to do with expressions.

    I would create a text layer expression that sets up an array of the numbers 1-49, but does not include any of the winning numbers. Then I’d randomly shuffle the resulting 44-element array and publish the result as the text of that text layer. The 44 non-winning balls would then retrieve the text array and decode their random number from it. Hard to be more specific without more info, but definitely do-able.

  • Esteban CV

    September 25, 2022 at 7:33 am

    I fully understand that it is complicated without information.

    And the case is quite special…

    I’ll quickly capture you (without final rendering) I think it will be the clearest.

  • Esteban CV

    September 25, 2022 at 8:17 am

    HI, Here are the different captures so that you can better understand I hope it will help you.

    All my balls here are called “DRONE”.

    My comp number is composed like this the frame “ETAPE 01”. These are the numbers for my ball number 01, the 49 possibilities.

    After, This composition goes through “ETAPE 02” which applies the mask in image sequence “Ball 01”.

    All my 49 balls work the same way, that is to say, a composition with my 49 layer number, which is then masked with matt depending on the ball concerned.

    Then, in the main composition “ETAPE 03”, I have a controller, with 5 drop-down menus to control the famous winning numbers.

    As you can see in “ETAPE 04”, when I tell my 01 ball to display the number 02 there is no problem.

    This is where it gets complicated. “ETAPE 05”, in my “DRONE 06-49” composition, I have my remaining 44 balls. The principle is exactly the same as my first 5 balls. Here, I tried to put a seedRandom, but the risk that for a number to appear twice is too great.

    Do you think it’s possible to tell my “CTRL_DRONE_06” dropdown menu to disable the dropdown values “CTRL_DRONE_01 to 05”?

    For example, if I choose in my 5 winning balls, the numbers 1, 2, 3, 4, 5, not to have the choice to take them on the “CTRL_DRONE_06”?

    Or even better, do you think we can remove the values ​​of “CTRL_DRONE_01 to 05” in the random seed selection range?

    something like this :


    random (1,49) – (value of dropmenu 01 + value of dropmenu 02 + value of dropmenu 03 + value of dropmenu 04 + value of dropmenu 05)

    Then in the control of the ball number 7, I would add the value of a ball 06 so that it does not fall on it, ect until the last one.

    I hope it’s better for you understanding, a huge thank you for everthing.


  • Dan Ebberts

    September 25, 2022 at 2:27 pm

    I still think it’s probably do-able, using the technique I described previously, but I fear it’s too complex to easily come up with a drop-in solution here, in this forum.

  • Esteban CV

    September 25, 2022 at 2:37 pm

    Great, thanks anyway for your help. I didn’t think it would be so hell on this thing!

Viewing 1 - 10 of 10 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy