Skip to main content
Peter James Zielinski
Known Participant
June 7, 2022
Question

Is there a shortcut or script to toggle the Clone Tool's Flip Horizontal and Flip Vertical states?

  • June 7, 2022
  • 1 reply
  • 554 views

Looking for a way to toggle the Flip Horizontal and Flip Vertical states in the Clone Source Panel.

 

Ideally by either launching a script or tying it to a keyboard shortcut instead of having to fish through the menu and manually click each time I need it.

 

Does anyone know if this is possible? Thanks!

This topic has been closed for replies.

1 reply

Legend
June 7, 2022

I've tried different ways and it doesn't seem to be possible to change the flipX and flipY brush options. The script works without errors, the object is changed, however, at the moment the set command is applied, these parameters are ignored. ¯\_(ツ)_/¯

 


#target photoshop
var s2t = stringIDToTypeID;

(ref = new ActionReference()).putProperty(s2t('property'), p = s2t('tool'));
ref.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum'));
var cTool = executeActionGet(ref).getEnumerationType(p);

if (cTool == s2t('cloneStampTool')) {
    var brush = executeActionGet(ref).getObjectValue(s2t('currentToolOptions')).getObjectValue(s2t('brush'));
    (r = new ActionReference()).putEnumerated(s2t("brush"), s2t("ordinal"), s2t("targetEnum"));
    (d = new ActionDescriptor()).putReference(s2t("target"), r);
    d1 = new ActionDescriptor();
    d1.putBoolean(x = s2t("flipX"), !brush.getBoolean(x)); //nothing changes
    d1.putBoolean(y = s2t("flipY"), !brush.getBoolean(y)); //nothing changes
    d.putObject(s2t("to"), s2t("brush"), d1);
    executeAction(s2t("set"), d, DialogModes.NO);
}

 

I love bugs  Photoshop!

Legend
June 7, 2022

Everything works in cs6 and cc2108. Or I didn't understand.

Legend
June 7, 2022

I'm changing the brush setting, but not the clone tool's source reflection setting (*FACEPALM*)

As i understand that the source reflection parameter is common for all cloning tools. But then some crazy things happen: a couple of times I was able to get it from the desc, and then it just ... disappeared! and I can neither read nor assign it (tried all clone tools and couldn't find a logical explanation for when these options appear or disappear in the desc)

 

"currentToolOptions": {
        "$SmpS": {
            "_enum": "$SmpT",
            "_value": "$SrcS"
        },
        "$StmA": false,
        "$StmB": false,
        "$StmI": false,
        "$StmS": false,
        "$szVr": {
            "$bVTy": 2,
            "$fStp": 1,
            "_obj": "$brVr",
            "jitter": {
                "_unit": "percentUnit",
                "_value": 0
            },
            "minimum": {
                "_unit": "percentUnit",
                "_value": 0
            }
        },
        "_obj": "currentToolOptions",
        "angleDynamics": {
            "$bVTy": 0,
            "$fStp": 1,
            "_obj": "$brVr",
            "jitter": {
                "_unit": "percentUnit",
                "_value": 0
            },
            "minimum": {
                "_unit": "percentUnit",
                "_value": 0
            }
        },
        "brush": {
            "_obj": "computedBrush",
            "angle": {
                "_unit": "angleUnit",
                "_value": 38
            },
            "diameter": {
                "_unit": "pixelsUnit",
                "_value": 30.20056189860692
            },
            "flipX": false,
            "flipY": false,
            "hardness": {
                "_unit": "percentUnit",
                "_value": 21
            },
            "interfaceIconFrameDimmed": true,
            "roundness": {
                "_unit": "percentUnit",
                "_value": 100
            },
            "spacing": {
                "_unit": "percentUnit",
                "_value": 25
            }
        },
        "brushProjection": false,
        "flipX": false,
        "flipY": false,
        "flow": 100,
        "healSmoothFactor": 5,
        "impressionist": false,
        "minimumDiameter": {
            "_unit": "percentUnit",
            "_value": 0
        },
        "minimumRoundness": {
            "_unit": "percentUnit",
            "_value": 25
        },
        "mode": {
            "_enum": "blendMode",
            "_value": "normal"
        },
        "opacity": 100,
        "pressureSmoothing": false,
        "roundnessDynamics": {
            "$bVTy": 0,
            "$fStp": 25,
            "_obj": "$brVr",
            "jitter": {
                "_unit": "percentUnit",
                "_value": 0
            },
            "minimum": {
                "_unit": "percentUnit",
                "_value": 0
            }
        },
        "smoothingCatchup": true,
        "smoothingCatchupAtEnd": false,
        "smoothingRadiusMode": false,
        "smoothingValue": 0,
        "smoothingZoomCompensation": true,
        "tiltScale": {
            "_unit": "percentUnit",
            "_value": 200
        },
        "useBrushPose": false,
        "useLegacy": false,
        "usePressureOverridesOpacity": false,
        "usePressureOverridesSize": false,
        "useTipDynamics": true
    },

 


посмотри тут https://community.adobe.com/t5/photoshop-ecosystem-discussions/could-we-get-the-property-of-the-clone-source-pannel/m-p/10344096#M230110

я пасс.