Skip to main content
Participating Frequently
November 16, 2024
Open for Voting

Generative Fill Property Panel Arrows for Variations

  • November 16, 2024
  • 4 replies
  • 384 views

Could the arrows from the 'contextual taskbar' be added to the properties panel to rotate through the generative variations?

 

OR~~~ a keyboard command to rotate through the options?

 

The 'contextual taskbar' is annoying since it's always on the screen covering other things up and can't snap into the prexisiting panel system to keep it in a place you want.  I have yet to find a spot to pin it where it doesn't get in the way and have to be moved at some point.

4 replies

Stephen Marsh
Community Expert
Community Expert
November 22, 2024

You're welcome @redflyr 

redflyrAuthor
Participating Frequently
November 21, 2024

@Stephen Marsh  Awesome! Thank you!

Stephen Marsh
Community Expert
Community Expert
November 18, 2024

@redflyr 

 

Until Adobe possibly implement such a feature, you can use the following script. Install it in the application/program folder's Presets/Scripts and assign a custom keyboard shortcut or record into an action for use with an F-key:

 

/*
Cycle Through Generative Fill Variations.jsx
v1.0 - 19th November 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/generative-fill-property-panel-arrows-for-variations/idi-p/14984091

Note: If more than 1 generative fill layer is present, the script will lose track of the last used index when switching between layers and variations!

Originally based on code from c.pfaffenbichler:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/is-there-a-quot-simple-quot-way-to-export-all-generation-variations/m-p/14442568
*/

#target photoshop;

try {
    if (app.documents.length) {
        selectNextGenerativeFillVariation();
    }
} catch (e) { }

function getCurrentGenerativeFillIndex() {
    try {
        var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
        desc.putReference(stringIDToTypeID("null"), ref);
        var result = executeAction(stringIDToTypeID("get"), desc, DialogModes.NO);

        if (result.hasKey(stringIDToTypeID("index"))) {
            return result.getInteger(stringIDToTypeID("index"));
        }
    } catch (e) {
        // Fall back to stored environment variable if current index cannot be fetched
    }
    return getLastUsedIndex();
}

function getLastUsedIndex() {
    var storedIndex = $.getenv("generativeFillIndex"); // Get the last used index from the environment variable
    return storedIndex ? parseInt(storedIndex) : 0;
}

function saveLastUsedIndex(index) {
    $.setenv("generativeFillIndex", index.toString()); // Save the index in the environment variable
}

function selectNextGenerativeFillVariation() {
    var lastIndex = getCurrentGenerativeFillIndex(); // Fetch the current active index
    var nextIndex = lastIndex + 1;
    var successfulSelection = selectGenerativeFillVariation(nextIndex);

    if (!successfulSelection) {
        nextIndex = 0; // Reset to the first variation
        successfulSelection = selectGenerativeFillVariation(nextIndex);
    }
    if (successfulSelection) {
        saveLastUsedIndex(nextIndex);
    }
}

function selectGenerativeFillVariation(theIndex) {
    try {
        if (!app.activeDocument.activeLayer) {
            return false;
        }
        var desc239 = new ActionDescriptor();
        var ref6 = new ActionReference();
        ref6.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
        desc239.putReference(stringIDToTypeID("null"), ref6);
        desc239.putInteger(stringIDToTypeID("index"), theIndex);
        executeAction(stringIDToTypeID("selectGeneratedVariation"), desc239, DialogModes.NO);
        return true;
    } catch (e) {
        return false;
    }
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Anshul_Saini
Community Manager
Community Manager
November 18, 2024

Hi @redflyr,

 

I can understand the frustration with the contextual taskbar taking up screen space, especially when you’re working with generative variations. Your suggestion to add the arrows to the properties panel or provide a keyboard shortcut is a great idea, as it would streamline the workflow and give more control over the interface.

 

Currently, the contextual taskbar appears to be the default way to navigate through variations, but I’ll pass along your feedback regarding the possibility of incorporating those arrows into the properties panel or a keyboard shortcut for easier access. This would definitely help reduce screen clutter and allow for more flexibility in managing the interface.

 

For now, you can explore the possibility of adjusting the workspace layout or pinning the contextual taskbar in a preferred location.

 

Thanks for sharing your idea—it’s always valuable to hear how users would like to optimize their experience!

 

Best,

Anshul Saini