This content has been marked as final.
Show 3 replies
-
1. Re: Detecting The Current Brush Size
(xbytor) Aug 15, 2008 9:43 AM (in response to Inchindown)>
> Is there anyway in javascript to detect the pixel size of the current brush?
It's fairly easy to set the current brush size via scripting listener code, but
reading the current value does not appear to be as simple.
If I had to do it, I would create a new (temporary) brush preset, save the
preset to disk, delete the temporary in-memory preset, then pick apart the saved
brush file to extract the brush size.
The last part is the only part that gets a bit tedious. The others can all be
taken care of via SL code. Or, even easier, the PresetsManager script in xtools.
-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com -
2. Re: Detecting The Current Brush Size
Inchindown Aug 15, 2008 10:39 AM (in response to Inchindown)Thanks X.
When you say "pick apart the saved brush file" do mean the SL code created when you saved the preset? -
3. Re: Detecting The Current Brush Size
(xbytor) Aug 15, 2008 12:21 PM (in response to Inchindown)> When you say "pick apart the saved brush file" do mean the SL code created when you saved the preset?
No. The SL code is relatively easy to deal with. What I was referring to was the
binary .abr file that brushes get stored in. There are a couple of bytes (or
more) of information that define the size of a brush in the preset file. It
should be possible to determine which bytes they are, but it might take a bit of
work.
-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com

