Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Brush Roundness + Angle

$
0
0

I am working on a custom HTML panel for controlling brush parameters to improve my workflow.

 

By using the ScriptListener I was able to get a simple script to change the size of the brush dynamically.

Unfortunately, ScriptListener does not update the script output when I change the brush roundness or the angle.

Does anybody know the right parameters? I have been trying to figure them out with the documentation but all I got was a headache.

 

Here is the js for rotation (what I am looking for is the equivalent for both roundness and angle):

 

function setBrushSize(size) {

  var idSet = charIDToTypeID( "setd" );

  var idNull = charIDToTypeID( "null" );

  var idBrush = charIDToTypeID( "Brsh" );

  var idOrdinal = charIDToTypeID( "Ordn" );

  var idTarget = charIDToTypeID( "Trgt" );

  var idTo = charIDToTypeID( "T   " );

  var idBrushSize = stringIDToTypeID( "masterDiameter" );

  var idPixels = charIDToTypeID( "#Pxl" );

 

  var desc1 = new ActionDescriptor();

  var desc2 = new ActionDescriptor();

  var ref1 = new ActionReference();

 

  ref1.putEnumerated( idBrush, idOrdinal, idTarget );

  desc1.putReference( idNull, ref1 );

  desc2.putUnitDouble( idBrushSize, idPixels, size );

  desc1.putObject( idTo, idBrush, desc2 );

  executeAction( idSet, desc1, DialogModes.NO );

}

 

Thanks in advance!

 

Pol


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>