P: spotHealingBrushTool: when the tool preset is activated, useScattering is enabled

3 Votes
Adobe Community Professional ,
Oct 18, 2021 Oct 18, 2021

Copy link to clipboard

Copied

The problem is with spotHealingBrushTool and colorReplacementBrushTool. Possibly backgroundEraserTool or artBrushTool (these drawing tools don't have the useScatter option either).

 

Discussion here: PS Script to switch Content-Aware vs Proximity Match in Spot Heal Tool and Patch tool question


Activate spotHealingBrushTool, check how tool works:

2021-10-19_08-27-15.png

Create any spotHealingBrushTool preset from current tool settings, activate it:

2021-10-19_08-30-49.png

Check how tool works now:

2021-10-19_08-27-51.png

A similar problem when trying to update tool parameters with a script. If you just read the tool parameters and then assign them to the same tool, the useScatter option will be activated:

 

 

s2t = stringIDToTypeID;
var r = new ActionReference();
r.putProperty(s2t("property"), s2t("tool"));
r.putEnumerated(s2t("application"), s2t("ordinal"), s2t("targetEnum"));
var d = executeActionGet(r).getObjectValue(s2t("currentToolOptions"));

var d1 = new ActionDescriptor(),
    r = new ActionReference();
r.putClass(s2t(app.currentTool));
d1.putReference(s2t("target"), r);
d1.putObject(s2t("to"), s2t("currentToolOptions"), d);
executeAction(s2t("set"), d1, DialogModes.NO);

 

 

At the same time, an attempt to read this parameter will throw an error:

 

 

s2t = stringIDToTypeID;

var r = new ActionReference();
r.putProperty(s2t("property"), s2t("tool"));
r.putEnumerated(s2t("application"), s2t("ordinal"), s2t("targetEnum"));
var d = executeActionGet(r).getObjectValue(s2t("currentToolOptions"));

try { d.getBoolean(s2t('useScatter')) } catch (e) { alert(e) } // error, option not exist

 

 

But if we put useScatter = false to the descriptor before updating the tool parameters, then the tool works normally: 

 

 

s2t = stringIDToTypeID;

var r = new ActionReference();
r.putProperty(s2t("property"), s2t("tool"));
r.putEnumerated(s2t("application"), s2t("ordinal"), s2t("targetEnum"));
var d = executeActionGet(r).getObjectValue(s2t("currentToolOptions"));

d.putBoolean(s2t('useScatter'), false) 

var d1 = new ActionDescriptor(),
    r = new ActionReference();
r.putClass(s2t(app.currentTool));
d1.putReference(s2t("target"), r);
d1.putObject(s2t("to"), s2t("currentToolOptions"), d);
executeAction(s2t("set"), d1, DialogModes.NO);

 

 

 

Bug Unresolved
TOPICS
Actions and scripting, SDK, Windows

Views

74

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
no replies

Have something to add?

Join the conversation