Script to Change Brush Blend Mode
I came across this script that changes the Brush blend mode:
// Select the paint brush tool
var idslct = stringIDToTypeID( "select" );
var desc226 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref170 = new ActionReference();
var idPbTl = stringIDToTypeID( "paintbrushTool" );
ref170.putClass( idPbTl );
desc226.putReference( idnull, ref170 );
executeAction( idslct, desc226, DialogModes.NO );
// blend mode
var desc = new ActionDescriptor();
var idset = stringIDToTypeID( "set" );
//alert(desc.getEnumerationValue(stringIDToTypeID("mode")));
desc.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendModel"), stringIDToTypeID("clearEnum"));
desc226.putObject( stringIDToTypeID( "to" ), stringIDToTypeID( "null" ), desc);
executeAction( idset, desc226, DialogModes.NO );
It works fine, but it has one flaw: it resets the brush settings. For example, if my brush has "Scattering" turned on by default, and I turn it off, the script checks it back on.
Is there a better way to change the brush blend mode? or maybe a way to first read the current brush settings, and re-applying them after changing the blend mode?
