Change smoothing for pencilTool

I try to change value with configs

[
    {
        "_obj": "set",
        "_target": [
            {
                "_ref": "brush",
                "_enum": "ordinal",
                "_value": "targetEnum"
            }
        ],
        "to": {
            "_obj": "computedBrush",
            "smoothingValue": {
                "_unit": "percentUnit",
                "_value": 93
            }
        },
        "_isCommand": true
    }
]

and

{
    "_obj": "set",
    "_target": [
        {
            "_ref": "pencilTool"
        }
    ],
    "to": {
        "_obj": "currentToolOptions",
        "smoothingValue": 28
    }
}

and run with

await require("photoshop").action.batchPlay(command, {
            synchronousExecution: false,
            modalBehavior: "fail"
        })

How I can change smoothing ?

And my currentToolOptions

   {
        "currentToolOptions": {
            "_obj": "currentToolOptions",
            "flow": 48,
            "smooth": 0,
            "$prVr": {
                "_obj": "$brVr",
                "$bVTy": 0,
                "$fStp": 25,
                "jitter": {
                    "_unit": "percentUnit",
                    "_value": 0
                },
                "minimum": {
                    "_unit": "percentUnit",
                    "_value": 0
                }
            },
            "$opVr": {
                "_obj": "$brVr",
                "$bVTy": 0,
                "$fStp": 25,
                "jitter": {
                    "_unit": "percentUnit",
                    "_value": 0
                },
                "minimum": {
                    "_unit": "percentUnit",
                    "_value": 0
                }
            },
            "mode": {
                "_enum": "blendMode",
                "_value": "normal"
            },
            "opacity": 59,
            "brush": {
                "_obj": "computedBrush",
                "diameter": {
                    "_unit": "pixelsUnit",
                    "_value": 42
                },
                "hardness": {
                    "_unit": "percentUnit",
                    "_value": 0
                },
                "angle": {
                    "_unit": "angleUnit",
                    "_value": 0
                },
                "roundness": {
                    "_unit": "percentUnit",
                    "_value": 100
                },
                "spacing": {
                    "_unit": "percentUnit",
                    "_value": 95
                },
                "interfaceIconFrameDimmed": true,
                "flipX": false,
                "flipY": false
            },
            "useTipDynamics": false,
            "useScatter": true,
            "count": 1,
            "bothAxes": false,
            "countDynamics": {
                "_obj": "$brVr",
                "$bVTy": 0,
                "$fStp": 25,
                "jitter": {
                    "_unit": "percentUnit",
                    "_value": 0
                },
                "minimum": {
                    "_unit": "percentUnit",
                    "_value": 0
                }
            },
            "scatterDynamics": {
                "_obj": "$brVr",
                "$bVTy": 0,
                "$fStp": 25,
                "jitter": {
                    "_unit": "percentUnit",
                    "_value": 30
                },
                "minimum": {
                    "_unit": "percentUnit",
                    "_value": 0
                }
            },
            "textureScale": {
                "_unit": "percentUnit",
                "_value": 100
            },
            "invertTexture": false,
            "protectTexture": false,
            "textureBrightness": 0,
            "textureContrast": 0,
            "useTexture": false,
            "dualBrush": {
                "_obj": "dualBrush",
                "useDualBrush": false
            },
            "useColorDynamics": false,
            "wetEdges": false,
            "noise": false,
            "usePaintDynamics": false,
            "useBrushPose": false,
            "repeat": false,
            "smoothing": true,
            "smoothingValue": 0,
            "smoothingRadiusMode": false,
            "smoothingCatchup": true,
            "smoothingCatchupAtEnd": false,
            "smoothingZoomCompensation": true,
            "pressureSmoothing": false,
            "foregroundColor": {
                "_obj": "RGBColor",
                "red": 29.00389116257429,
                "grain": 26.000000350177288,
                "blue": 21.00389163941145
            },
            "usePressureOverridesSize": false,
            "usePressureOverridesOpacity": false,
            "useLegacy": false
        },

Not sure if this is what you’re looking for, but you have to write back the tool options as described in this post.

1 Like