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

Script to adjust brush Angle Jitter

Community Beginner ,
Dec 19, 2022 Dec 19, 2022

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)

angleJitter.jpg

 

//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

 

TOPICS
Actions and scripting , macOS , Windows

Views

260

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

correct answers 1 Correct answer

Community Expert , Dec 27, 2022 Dec 27, 2022

@r-bin has offered some code on this: 

 
Including some of this code into the one posted here might help: 
// 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);
...

Votes

Translate

Translate
Adobe
Community Expert ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

Votes

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
Community Expert ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

@r-bin has offered some code on this: 

 
Including some of this code into the one posted here might help: 
// 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);
};

Screenshot 2022-12-27 at 12.35.12.pngScreenshot 2022-12-27 at 12.35.20.png

Votes

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
Community Beginner ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

LATEST

Works perfectly, and thanks for the link I would never have found that otherwise.

Votes

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