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

Request an eyeball icon in Layers Panel for Blending Options

Explorer ,
Aug 29, 2023 Aug 29, 2023

Copy link to clipboard

Copied

Most of the Layer Style Effects (stroke, drop shadow, etc.) appear under Effects on the Layers palette with an eyeball that can be clicked off/on. However, there is no eyeball for Blending Options, no way to easily toggle just Blending Options off/on without opening the Layer Style panel and unchecking the Preview box. If there are multiple effects, I can turn off/on all the effects with the eyeball next to Effects, but if Blending Options is the only effect, there is no eyeball, just the overlapping boxes icon next to the layer name. It would make my life easier and save time if Blending Options could be toggled off/on more easily. It could have an eyeball like the other Layer Style Effects. Or, if we could click the overlapping boxes icon and turn Blending Options off/on that way. 

Thanks for considering this.

Idea No status
TOPICS
Actions and scripting

Views

94

Translate

Translate

Report

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
3 Comments
Community Expert ,
Aug 29, 2023 Aug 29, 2023

Copy link to clipboard

Copied

You have my vote!

 

I have an idea which might work in the meantime, I'll look into it...

Votes

Translate

Translate

Report

Report
Community Expert ,
Aug 29, 2023 Aug 29, 2023

Copy link to clipboard

Copied

As there is no preview for blend if, the following script is a hack...

 

1) The first run of the script will remove the blend if settings for the active layer, resetting them back to the default state – while retaining other layer styles.

 

2) Running the script a second time with the ALT/OPT key held down will restore the blend if settings to the same selected layer.

 

Although technically not a preview toggle, it sort of works like one (the best that I can do).

 

/*
Remove & Restore Blend If.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/request-an-eyeball-icon-in-layers-panel-for-blending-options/idi-p/14046871
v1.0, 30th August 2023, Stephen Marsh
*/

#target photoshop

if (documents.length) {

    /* Step 2 - Hold down the ALT/OPT key to restore the blend if settings */
    if (ScriptUI.environment.keyboardState.altKey) {

        // Check for active layer by jazz-y
        s2t = stringIDToTypeID;
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayers'));
        r.putEnumerated(s2t("document"), s2t("ordinal"), s2t("targetEnum"));
        if (executeActionGet(r).getList(p).count) {

            // Check that the active layer matches the active session environment variable
            if (activeDocument.activeLayer.name === theLayer_3f5au82v) {
                // Restore the active layer properties from the layer style copy
                try {
                    pasteLayerEffects();
                } catch (e) {
                    alert('An unexpected error occurred!');
                }
            } else {
                alert("Layer '" + theLayer_3f5au82v + "' isn't selected!" + "\r" + "(or an unexpected error occurred)");
            }

        } else {
            alert('A layer must be selected!');
        }

    /* Step 1 - Copy and remove the blend if settings */
    } else {

        // Check for active layer by jazz-y
        s2t = stringIDToTypeID;
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayers'));
        r.putEnumerated(s2t("document"), s2t("ordinal"), s2t("targetEnum"));
        if (executeActionGet(r).getList(p).count) {

            // Save selected layer name to an active session environment variable
            $.setenv(theLayer_3f5au82v = activeDocument.activeLayer.name);

            // Copy the active layer properties to a layer style
            copyLayerEffects();

            // Reset the blend if sliders
            if (activeDocument.mode === DocumentMode.GRAYSCALE || activeDocument.mode === DocumentMode.DUOTONE) {
                resetGRAYblendif(0, 0, 255, 255, 0, 0, 255, 255);
            } else if (activeDocument.mode === DocumentMode.RGB) {
                resetRGBblendif(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255);
            } else if (activeDocument.mode === DocumentMode.LAB) {
                resetLABblendif(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255);
            } else(activeDocument.mode === DocumentMode.CMYK) {
                resetCMYKblendif(0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255);
            }

        } else {
            alert('A layer must be selected!');
        }

    }

} else {
    alert("A document must be open to run this script!");
}


/* Functions */

function resetGRAYblendif(srcBlackMin, srcBlackMax, srcWhiteMin, srcWhiteMax, destBlackMin, destBlackMax, destWhiteMin, desaturate) {
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var descriptor3 = new ActionDescriptor();
    var list = new ActionList();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference);
    reference2.putEnumerated(s2t("channel"), s2t("channel"), s2t("black"));
    descriptor3.putReference(s2t("channel"), reference2);
    descriptor3.putInteger(s2t("srcBlackMin"), srcBlackMin);
    descriptor3.putInteger(s2t("srcBlackMax"), srcBlackMax);
    descriptor3.putInteger(s2t("srcWhiteMin"), srcWhiteMin);
    descriptor3.putInteger(s2t("srcWhiteMax"), srcWhiteMax);
    descriptor3.putInteger(s2t("destBlackMin"), destBlackMin);
    descriptor3.putInteger(s2t("destBlackMax"), destBlackMax);
    descriptor3.putInteger(s2t("destWhiteMin"), destWhiteMin);
    descriptor3.putInteger(s2t("desaturate"), desaturate);
    list.putObject(s2t("blendRange"), descriptor3);
    descriptor2.putList(s2t("blendRange"), list);
    descriptor.putObject(s2t("to"), s2t("layer"), descriptor2);
    executeAction(s2t("set"), descriptor, DialogModes.NO);
}

function resetRGBblendif(srcBlackMin, srcBlackMax, srcWhiteMin, srcWhiteMax, destBlackMin, destBlackMax, destWhiteMin, desaturate, srcBlackMin2, srcBlackMax2, srcWhiteMin2, srcWhiteMax2, destBlackMin2, destBlackMax2, destWhiteMin2, desaturate2, srcBlackMin3, srcBlackMax3, srcWhiteMin3, srcWhiteMax3, destBlackMin3, destBlackMax3, destWhiteMin3, desaturate3, srcBlackMin4, srcBlackMax4, srcWhiteMin4, srcWhiteMax4, destBlackMin4, destBlackMax4, destWhiteMin4, desaturate4) {
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var descriptor3 = new ActionDescriptor();
    var descriptor4 = new ActionDescriptor();
    var descriptor5 = new ActionDescriptor();
    var descriptor6 = new ActionDescriptor();
    var list = new ActionList();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    var reference3 = new ActionReference();
    var reference4 = new ActionReference();
    var reference5 = new ActionReference();
    reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference);
    reference2.putEnumerated(s2t("channel"), s2t("channel"), s2t("gray"));
    descriptor3.putReference(s2t("channel"), reference2);
    descriptor3.putInteger(s2t("srcBlackMin"), srcBlackMin);
    descriptor3.putInteger(s2t("srcBlackMax"), srcBlackMax);
    descriptor3.putInteger(s2t("srcWhiteMin"), srcWhiteMin);
    descriptor3.putInteger(s2t("srcWhiteMax"), srcWhiteMax);
    descriptor3.putInteger(s2t("destBlackMin"), destBlackMin);
    descriptor3.putInteger(s2t("destBlackMax"), destBlackMax);
    descriptor3.putInteger(s2t("destWhiteMin"), destWhiteMin);
    descriptor3.putInteger(s2t("desaturate"), desaturate);
    list.putObject(s2t("blendRange"), descriptor3);
    reference3.putEnumerated(s2t("channel"), s2t("channel"), s2t("red"));
    descriptor4.putReference(s2t("channel"), reference3);
    descriptor4.putInteger(s2t("srcBlackMin"), srcBlackMin2);
    descriptor4.putInteger(s2t("srcBlackMax"), srcBlackMax2);
    descriptor4.putInteger(s2t("srcWhiteMin"), srcWhiteMin2);
    descriptor4.putInteger(s2t("srcWhiteMax"), srcWhiteMax2);
    descriptor4.putInteger(s2t("destBlackMin"), destBlackMin2);
    descriptor4.putInteger(s2t("destBlackMax"), destBlackMax2);
    descriptor4.putInteger(s2t("destWhiteMin"), destWhiteMin2);
    descriptor4.putInteger(s2t("desaturate"), desaturate2);
    list.putObject(s2t("blendRange"), descriptor4);
    reference4.putEnumerated(s2t("channel"), s2t("channel"), s2t("grain"));
    descriptor5.putReference(s2t("channel"), reference4);
    descriptor5.putInteger(s2t("srcBlackMin"), srcBlackMin3);
    descriptor5.putInteger(s2t("srcBlackMax"), srcBlackMax3);
    descriptor5.putInteger(s2t("srcWhiteMin"), srcWhiteMin3);
    descriptor5.putInteger(s2t("srcWhiteMax"), srcWhiteMax3);
    descriptor5.putInteger(s2t("destBlackMin"), destBlackMin3);
    descriptor5.putInteger(s2t("destBlackMax"), destBlackMax3);
    descriptor5.putInteger(s2t("destWhiteMin"), destWhiteMin3);
    descriptor5.putInteger(s2t("desaturate"), desaturate3);
    list.putObject(s2t("blendRange"), descriptor5);
    reference5.putEnumerated(s2t("channel"), s2t("channel"), s2t("blue"));
    descriptor6.putReference(s2t("channel"), reference5);
    descriptor6.putInteger(s2t("srcBlackMin"), srcBlackMin4);
    descriptor6.putInteger(s2t("srcBlackMax"), srcBlackMax4);
    descriptor6.putInteger(s2t("srcWhiteMin"), srcWhiteMin4);
    descriptor6.putInteger(s2t("srcWhiteMax"), srcWhiteMax4);
    descriptor6.putInteger(s2t("destBlackMin"), destBlackMin4);
    descriptor6.putInteger(s2t("destBlackMax"), destBlackMax4);
    descriptor6.putInteger(s2t("destWhiteMin"), destWhiteMin4);
    descriptor6.putInteger(s2t("desaturate"), desaturate4);
    list.putObject(s2t("blendRange"), descriptor6);
    descriptor2.putList(s2t("blendRange"), list);
    descriptor.putObject(s2t("to"), s2t("layer"), descriptor2);
    executeAction(s2t("set"), descriptor, DialogModes.NO);
}

function resetLABblendif(srcBlackMin, srcBlackMax, srcWhiteMin, srcWhiteMax, destBlackMin, destBlackMax, destWhiteMin, desaturate, srcBlackMin2, srcBlackMax2, srcWhiteMin2, srcWhiteMax2, destBlackMin2, destBlackMax2, destWhiteMin2, desaturate2, srcBlackMin3, srcBlackMax3, srcWhiteMin3, srcWhiteMax3, destBlackMin3, destBlackMax3, destWhiteMin3, desaturate3) {
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var descriptor3 = new ActionDescriptor();
    var descriptor4 = new ActionDescriptor();
    var descriptor5 = new ActionDescriptor();
    var list = new ActionList();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    var reference3 = new ActionReference();
    var reference4 = new ActionReference();
    reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference);
    reference2.putEnumerated(s2t("channel"), s2t("channel"), s2t("lightness"));
    descriptor3.putReference(s2t("channel"), reference2);
    descriptor3.putInteger(s2t("srcBlackMin"), srcBlackMin);
    descriptor3.putInteger(s2t("srcBlackMax"), srcBlackMax);
    descriptor3.putInteger(s2t("srcWhiteMin"), srcWhiteMin);
    descriptor3.putInteger(s2t("srcWhiteMax"), srcWhiteMax);
    descriptor3.putInteger(s2t("destBlackMin"), destBlackMin);
    descriptor3.putInteger(s2t("destBlackMax"), destBlackMax);
    descriptor3.putInteger(s2t("destWhiteMin"), destWhiteMin);
    descriptor3.putInteger(s2t("desaturate"), desaturate);
    list.putObject(s2t("blendRange"), descriptor3);
    reference3.putEnumerated(s2t("channel"), s2t("channel"), s2t("a"));
    descriptor4.putReference(s2t("channel"), reference3);
    descriptor4.putInteger(s2t("srcBlackMin"), srcBlackMin2);
    descriptor4.putInteger(s2t("srcBlackMax"), srcBlackMax2);
    descriptor4.putInteger(s2t("srcWhiteMin"), srcWhiteMin2);
    descriptor4.putInteger(s2t("srcWhiteMax"), srcWhiteMax2);
    descriptor4.putInteger(s2t("destBlackMin"), destBlackMin2);
    descriptor4.putInteger(s2t("destBlackMax"), destBlackMax2);
    descriptor4.putInteger(s2t("destWhiteMin"), destWhiteMin2);
    descriptor4.putInteger(s2t("desaturate"), desaturate2);
    list.putObject(s2t("blendRange"), descriptor4);
    reference4.putEnumerated(s2t("channel"), s2t("channel"), s2t("b"));
    descriptor5.putReference(s2t("channel"), reference4);
    descriptor5.putInteger(s2t("srcBlackMin"), srcBlackMin3);
    descriptor5.putInteger(s2t("srcBlackMax"), srcBlackMax3);
    descriptor5.putInteger(s2t("srcWhiteMin"), srcWhiteMin3);
    descriptor5.putInteger(s2t("srcWhiteMax"), srcWhiteMax3);
    descriptor5.putInteger(s2t("destBlackMin"), destBlackMin3);
    descriptor5.putInteger(s2t("destBlackMax"), destBlackMax3);
    descriptor5.putInteger(s2t("destWhiteMin"), destWhiteMin3);
    descriptor5.putInteger(s2t("desaturate"), desaturate3);
    list.putObject(s2t("blendRange"), descriptor5);
    descriptor2.putList(s2t("blendRange"), list);
    descriptor.putObject(s2t("to"), s2t("layer"), descriptor2);
    executeAction(s2t("set"), descriptor, DialogModes.NO);
}

function resetCMYKblendif(srcBlackMin, srcBlackMax, srcWhiteMin, srcWhiteMax, destBlackMin, destBlackMax, destWhiteMin, desaturate, srcBlackMin2, srcBlackMax2, srcWhiteMin2, srcWhiteMax2, destBlackMin2, destBlackMax2, destWhiteMin2, desaturate2, srcBlackMin3, srcBlackMax3, srcWhiteMin3, srcWhiteMax3, destBlackMin3, destBlackMax3, destWhiteMin3, desaturate3, srcBlackMin4, srcBlackMax4, srcWhiteMin4, srcWhiteMax4, destBlackMin4, destBlackMax4, destWhiteMin4, desaturate4, srcBlackMin5, srcBlackMax5, srcWhiteMin5, srcWhiteMax5, destBlackMin5, destBlackMax5, destWhiteMin5, desaturate5) {
    var s2t = function (s) {
        return app.stringIDToTypeID(s);
    };
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var descriptor3 = new ActionDescriptor();
    var descriptor4 = new ActionDescriptor();
    var descriptor5 = new ActionDescriptor();
    var descriptor6 = new ActionDescriptor();
    var descriptor7 = new ActionDescriptor();
    var list = new ActionList();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    var reference3 = new ActionReference();
    var reference4 = new ActionReference();
    var reference5 = new ActionReference();
    var reference6 = new ActionReference();
    reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference);
    reference2.putEnumerated(s2t("channel"), s2t("channel"), s2t("gray"));
    descriptor3.putReference(s2t("channel"), reference2);
    descriptor3.putInteger(s2t("srcBlackMin"), srcBlackMin);
    descriptor3.putInteger(s2t("srcBlackMax"), srcBlackMax);
    descriptor3.putInteger(s2t("srcWhiteMin"), srcWhiteMin);
    descriptor3.putInteger(s2t("srcWhiteMax"), srcWhiteMax);
    descriptor3.putInteger(s2t("destBlackMin"), destBlackMin);
    descriptor3.putInteger(s2t("destBlackMax"), destBlackMax);
    descriptor3.putInteger(s2t("destWhiteMin"), destWhiteMin);
    descriptor3.putInteger(s2t("desaturate"), desaturate);
    list.putObject(s2t("blendRange"), descriptor3);
    reference3.putEnumerated(s2t("channel"), s2t("channel"), s2t("cyan"));
    descriptor4.putReference(s2t("channel"), reference3);
    descriptor4.putInteger(s2t("srcBlackMin"), srcBlackMin2);
    descriptor4.putInteger(s2t("srcBlackMax"), srcBlackMax2);
    descriptor4.putInteger(s2t("srcWhiteMin"), srcWhiteMin2);
    descriptor4.putInteger(s2t("srcWhiteMax"), srcWhiteMax2);
    descriptor4.putInteger(s2t("destBlackMin"), destBlackMin2);
    descriptor4.putInteger(s2t("destBlackMax"), destBlackMax2);
    descriptor4.putInteger(s2t("destWhiteMin"), destWhiteMin2);
    descriptor4.putInteger(s2t("desaturate"), desaturate2);
    list.putObject(s2t("blendRange"), descriptor4);
    reference4.putEnumerated(s2t("channel"), s2t("channel"), s2t("magenta"));
    descriptor5.putReference(s2t("channel"), reference4);
    descriptor5.putInteger(s2t("srcBlackMin"), srcBlackMin3);
    descriptor5.putInteger(s2t("srcBlackMax"), srcBlackMax3);
    descriptor5.putInteger(s2t("srcWhiteMin"), srcWhiteMin3);
    descriptor5.putInteger(s2t("srcWhiteMax"), srcWhiteMax3);
    descriptor5.putInteger(s2t("destBlackMin"), destBlackMin3);
    descriptor5.putInteger(s2t("destBlackMax"), destBlackMax3);
    descriptor5.putInteger(s2t("destWhiteMin"), destWhiteMin3);
    descriptor5.putInteger(s2t("desaturate"), desaturate3);
    list.putObject(s2t("blendRange"), descriptor5);
    reference5.putEnumerated(s2t("channel"), s2t("channel"), s2t("yellow"));
    descriptor6.putReference(s2t("channel"), reference5);
    descriptor6.putInteger(s2t("srcBlackMin"), srcBlackMin4);
    descriptor6.putInteger(s2t("srcBlackMax"), srcBlackMax4);
    descriptor6.putInteger(s2t("srcWhiteMin"), srcWhiteMin4);
    descriptor6.putInteger(s2t("srcWhiteMax"), srcWhiteMax4);
    descriptor6.putInteger(s2t("destBlackMin"), destBlackMin4);
    descriptor6.putInteger(s2t("destBlackMax"), destBlackMax4);
    descriptor6.putInteger(s2t("destWhiteMin"), destWhiteMin4);
    descriptor6.putInteger(s2t("desaturate"), desaturate4);
    list.putObject(s2t("blendRange"), descriptor6);
    reference6.putEnumerated(s2t("channel"), s2t("channel"), s2t("black"));
    descriptor7.putReference(s2t("channel"), reference6);
    descriptor7.putInteger(s2t("srcBlackMin"), srcBlackMin5);
    descriptor7.putInteger(s2t("srcBlackMax"), srcBlackMax5);
    descriptor7.putInteger(s2t("srcWhiteMin"), srcWhiteMin5);
    descriptor7.putInteger(s2t("srcWhiteMax"), srcWhiteMax5);
    descriptor7.putInteger(s2t("destBlackMin"), destBlackMin5);
    descriptor7.putInteger(s2t("destBlackMax"), destBlackMax5);
    descriptor7.putInteger(s2t("destWhiteMin"), destWhiteMin5);
    descriptor7.putInteger(s2t("desaturate"), desaturate5);
    list.putObject(s2t("blendRange"), descriptor7);
    descriptor2.putList(s2t("blendRange"), list);
    descriptor.putObject(s2t("to"), s2t("layer"), descriptor2);
    executeAction(s2t("set"), descriptor, DialogModes.NO);
}

function copyLayerEffects() {
    var idcopyEffects = stringIDToTypeID("copyEffects");
    executeAction(idcopyEffects, undefined, DialogModes.NO);
}

function pasteLayerEffects() {
    var idpasteEffects = stringIDToTypeID("pasteEffects");
    var desc461 = new ActionDescriptor();
    var idallowPasteFXOnLayerSet = stringIDToTypeID("allowPasteFXOnLayerSet");
    desc461.putBoolean(idallowPasteFXOnLayerSet, true);
    executeAction(idpasteEffects, desc461, DialogModes.NO);
}

 

If you prefer to run two separate scripts using different keyboard shortcuts rather than using the depressed ALT/OPT key via the script menu, then I can post that code as well.

 

Info on saving and installing scripts here:

 

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

Votes

Translate

Translate

Report

Report
Explorer ,
Aug 29, 2023 Aug 29, 2023

Copy link to clipboard

Copied

LATEST

Wow Steven - thanks! I have not worked with scripts other than those that come built in so I will have to check out the blog you reference. I hope the Adobe ebgineers will notice our activity!

Votes

Translate

Translate

Report

Report