Copy link to clipboard
Copied
The script below was provided by jazz-y to adjust brush settings parameter "Flip X"
Original link here: https://community.adobe.com/t5/photoshop-ecosystem-discussions/flipx-of-brush-using-script/m-p/13324...
Works like a dream - I had spent many many unsucessful hours trying not to get the brush to "reset" until I came across this gem.
My query is : Is it possible to go a step further and adjust the parameter "Angle Jitter"? (screenshot below)
//script start
var s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('currentToolOptions'));
r.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum'));
var tool = executeActionGet(r).getObjectValue(p);
if (tool.hasKey(s2t('brush'))) {
var brush = tool.getObjectValue(s2t('brush'));
brush.putBoolean(s2t('flipX'), true);
tool.putObject(s2t('brush'), s2t('computedBrush'), brush);
(r = new ActionReference()).putClass(s2t(currentTool));
(d = new ActionDescriptor()).putReference(s2t("target"), r);
d.putObject(s2t("to"), s2t("target"), tool);
executeAction(s2t("set"), d, DialogModes.NO);
}
//end
@r-bin has offered some code on this:
// set angle jitter to 13;
// 2022, use it at your own risk;
var s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('currentToolOptions'));
r.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum'));
var tool = executeActionGet(r).getObjectValue(p);
Copy link to clipboard
Copied
Try to tag @jazz-y @c.pfaffenbichler @r-bin @Stephen_A_Marsh
Copy link to clipboard
Copied
@r-bin has offered some code on this:
// set angle jitter to 13;
// 2022, use it at your own risk;
var s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('currentToolOptions'));
r.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum'));
var tool = executeActionGet(r).getObjectValue(p);
if (tool.hasKey(s2t('brush'))) {
var brush = tool.getObjectValue(s2t('brush'));
//brush.putBoolean(s2t('flipX'), true);
//////
var angleDynamics = new ActionDescriptor();
angleDynamics.putInteger(charIDToTypeID("bVTy"), 0);
angleDynamics.putInteger(charIDToTypeID("fStp"), 25);
angleDynamics.putUnitDouble(stringIDToTypeID("jitter"), stringIDToTypeID("percentUnit"), 13);
angleDynamics.putUnitDouble(stringIDToTypeID("minimum"), stringIDToTypeID("percentUnit"), 0);
tool.putObject(stringIDToTypeID("angleDynamics"), charIDToTypeID("brVr"), angleDynamics);
//////
tool.putObject(s2t('brush'), s2t('computedBrush'), brush);
(r = new ActionReference()).putClass(s2t(currentTool));
(d = new ActionDescriptor()).putReference(s2t("target"), r);
d.putObject(s2t("to"), s2t("target"), tool);
executeAction(s2t("set"), d, DialogModes.NO);
};
Copy link to clipboard
Copied
Works perfectly, and thanks for the link I would never have found that otherwise.