Hi everyone,
Is there a way to get/set the brush strength for the blur/sharpen/smudge tools?
Thanks
Hi everyone,
Is there a way to get/set the brush strength for the blur/sharpen/smudge tools?
Thanks
you’ll have to use batchPlay
here’s a starting point to better understand how
const brushOptions = {
_obj: "get",
_target: [
{
_property: "currentToolOptions"
},
{ _ref: "application" }
]
};
I am looking at the currentToolOptions and see diameter, hardness, angle. But I do not see anything for strength
async function getCurrentToolOptions () {
const result = await batchPlay(
[
{
"_obj": "get",
"_target": [
{
"_property": "currentToolOptions"
},
{
"_ref": "application",
"_enum": "ordinal",
"_value": "targetEnum"
}
],
"_options": {
"dialogOptions": "dontDisplay"
}
}
],{
"synchronousExecution": false
});
return result[0].currentToolOptions;
}
let ToolOptions = await getCurrentToolOptions();
console.log(ToolOptions.brush.hardness)
console.log(ToolOptions.flow)
EDIT : Sorry, I seem to misread your comment… what do you mean by strength?
you can set a unique known value to whatever property you want to work with and look for that value in the result.
If I select the blur tool on Photoshop, I want to be able to adjust the strength% of the brush!
Using your code snippet, I do not see ToolOptions.brush.strength
Internal names can be different from the ones used by the UI
as suggested, I set it to a unique value (e.g. “69”) and it turned out strength is flow
ToolOptions.flow