Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Select from an effects drop down menu script

  • Select from an effects drop down menu script

    Posted by Maria Pixamins on December 29, 2023 at 5:35 pm

    Hi!

    I need a script (drop down) to select the included colorama (effect) preset palette in order to add that color selection feature in a mogrt file. Any ideas?

    P.S.

    It would be really great if there was a way to select custom colors but that night be not an option 🙁

    Maria Pixamins replied 2 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Reid Vanvoris

    December 29, 2023 at 6:17 pm

    Watch this first: https://youtu.be/MHFgJRtxwDE

    The video above explains how to get ChatGPT to generate an AE script and how to install it in AE for testing.

    NOTE: I M NOT A CODER, SO UNFORTUNATELY, YOU CANNOT ASK FOR MY HELP. I JUST HAD PREVIOUSLY SEEN THE VIDEOS LOOSELY RELATED TO WHAT YOU NEED TO DO AND SO I SENT WHAT I SENT. GOOD LUCK.

    Below is a ChatGPT generated script using a slightly modified prompt based on what you asked for. You might want to go to Chap GPT and try some of your own prompts there. Remember, you can tell ChatGPT what worked and what didn’t and ask it to modify it. You might want to save each coding created because when modifying prompts, ChatGPT occasionally goes too far off course or misunderstands what you were saying worked and what you were asking to modify. Saving previousl generated code that at least partially worked is kind of like saving an undo list

    1. Gather Essential Information:

  • Available Colorama Presets: List the specific preset palettes you want to include in the menu.
  • Target Layer(s): Determine the layer(s) where the Colorama effect should be applied and controlled by the menu.
  • MOGRT Integration: Decide how you’ll integrate the menu into the MOGRT’s Essential Graphics panel.
  • 2. Script Structure:

    <code-block _nghost-ng-c51771041=”” ng-version=”0.0.0-PLACEHOLDER”>

    JavaScript

    <pre _ngcontent-ng-c51771041=””><code _ngcontent-ng-c51771041=”” role=”text”>// Define function to create the menu
    function createColoramaMenu() {
    // Create menu object
    var menu = new Menu();

    // Add menu items for each preset (replace with actual presets)
    menu.addItem(“Preset 1”);
    menu.addItem(“Preset 2”);
    // …

    // Define menu behavior when a preset is selected
    menu.onSelect = function(item) {
    // Apply the selected preset to the target layer(s)
    applyPreset(item.text);
    };

    // Display the menu
    menu.show();
    }

    // Function to apply a preset to the target layer(s)
    function applyPreset(presetName) {
    // Get the target layer(s)
    var targetLayer = app.project.activeItem.selectedLayers[0]; // Adjust for multiple layers

    // Apply or modify Colorama effect based on preset
    if (targetLayer.hasEffect(“Colorama”)) {
    // Modify existing effect
    var coloramaEffect = targetLayer.effect(“Colorama”);
    // … set preset values based on presetName
    } else {
    // Apply new effect
    targetLayer.applyEffect(“Colorama”);
    // … set preset values based on presetName
    }
    }

    // Example usage:
    createColoramaMenu();

    Use code with caution. Learn more

    </code-block><code-block _nghost-ng-c51771041=”” ng-version=”0.0.0-PLACEHOLDER”></code-block>

    3. MOGRT Integration:

  • Dropdown Menu Control: Use the “Dropdown Menu Control” effect in your MOGRT composition to create the menu UI.
  • Link Menu to Script: In the “Dropdown Menu Control” effect’s settings, link the “On Selection Change” property to the createColoramaMenu function.
  • 4. Testing and Refinement:

  • Thorough Testing: Test the script extensively to ensure it works as expected in different scenarios.
  • Customization: Adjust the script and MOGRT integration to fit your specific needs.
  • 5. Troubleshooting:

  • Error Handling: Implement error handling to catch potential issues and provide feedback to users.
  • Debugging: Use debugging tools (like alert() or the ExtendScript Toolkit) to identify and fix any problems.
  • Remember:

  • Expressions: You’ll likely need to use expressions to link the menu selection to the Colorama effect’s properties within the MOGRT.
  • MOGRT Best Practices: Follow Adobe’s guidelines for creating MOGRTs for optimal compatibility and user experience.
  • Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Maria Pixamins

    December 29, 2023 at 6:52 pm

    Thanks 🙂 But unfortunately this looks like too complicated for me. I really dont know where to put that! What I think I need might be a “Drop down menu” from the “effects” linked somehow with the color presets of the Colorama effect.

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