javascript - Photoshop Javascript : How to Change the brush Mode with javascript?

标签 javascript photoshop photoshop-script

真的是 photoshop 脚本的初学者。

现在我正在制作一些对我的工作流程有用的脚本,例如可见性切换内容。

我现在真正想知道的是如何使用 javascript 更改“图层混合模式”而不是“画笔模式”(如正常、乘法、清除等...)。我似乎找不到一些资源来控制画笔模式。

希望你们能帮我解决这个问题。

最佳答案

这是可能的,这是我拼凑的一个片段,它通过创建一个 Action 并执行它来工作。 (通常不能通过常规操作来更改画笔模式,但在 CC 2017 中确实可以这样做)

var bmsS = ["normal", "dissolve", "behind", "clearEnum",
            "darken", "multiply", "colorBurn", "linearBurn", "darkerColor",
            "lighten", "screen", "colorDodge", "linearDodge", "lighterColor",
            "overlay", "softLight", "hardLight", "vividLight", "linearLight", "pinLight", "hardMix",
            "difference", "exclusion", "blendSubtraction", "blendDivide",
            "hue", "saturation", "color", "luminosity",  ]; 

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

关于javascript - Photoshop Javascript : How to Change the brush Mode with javascript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44508493/

相关文章:

javascript - 在 AngularJS/Javascript 中使用 YouTube API

javascript - meteor.js 中的无限滚动

javascript - 循环遍历并行层

将 Illustrator 导出到分层 PSD

qt - 模糊效果小部件

javascript - Photoshop 脚本 - 如何检查是否有文档已打开?

javascript - 用于脚本的 Web 服务器上的 Photoshop

javascript - MVC 5如何强制浏览器打开PDF文件

javascript - 如何在回调中访问正确的“this”?

html - block 元素下的 CSS 阴影(不是框阴影,阴影图像,旧方法)