如何使用 Photoshop 脚本修改混合选项?
我有一个 Photoshop Javascript 脚本,可以在不同的图层之间循环,我想根据图层的名称为每个图层提供不同的外发光。
有人可以举例说明如何以编程方式更改 ArtLayer 类的混合选项吗?
I have a Photoshop Javascript script that cycles through different layers and I want to give a different outer glow to each layer based on the name of the layer.
Can someone give an example on how to change the blending options of an ArtLayer class programatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,没有简单的方法来添加图层样式。
有
.applyStyle("Puzzle (Image)")
但其他样式未包含在文档中,并且我在任何地方都找不到其他样式。所以你必须使用解决方法(棘手且复杂的过程)。
第 1 步(如果您想要现成的解决方案,请跳过)
首先,您需要执行操作(向图层添加外发光),然后转换为 .jsx 脚本。
您需要使用此脚本进行转换:
http://ps-scripts .cvs.sourceforge.net/viewvc/ps-scripts/xtools/apps/ActionToJavascript.jsx?revision=1.29
从 Ps 或从运行ExtendScript,选择您的操作并保存。
步骤 2
在你新创建的脚本中,你会看到可怕且不可读的代码,它会立即工作,但是如果你想使用不同的设置(颜色、不透明度、混合模式等),你需要创建函数。
这是干净的版本。
步骤 3
您将需要另一个脚本文件来调用该函数,将其放在同一文件夹中(将“antoxa_myGlow.jsx”替换为您的脚本名称)。
目前,如果您选择,它将仅适用于一个选定的层多层,它会给你错误。我还不知道如何将函数应用到多个选定的图层。
Unfortunately, there's no easy way to add layer styles.
There is
.applyStyle("Puzzle (Image)")
but other styles are not included in documentation, and I couldn't find other styles anywhere.So you have to use workaround (tricky and complicated process).
Step 1 (Skip if you want ready solution)
First of all, you'll need to make action (add outer glow to layer) and then convert to .jsx script.
You need to use this script for conversion:
http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/apps/ActionToJavascript.jsx?revision=1.29
Run it from Ps or from ExtendScript, choose your action and save it.
Step 2
In your newly created script, you'll see horrible and unreadable code, it will work right away, however you'll need to make function if you want to use different settings (color, opacity, blend mode, etc).
Here's clean version.
Step 3
You will need another script file to call that function, place it in same folder (replace "antoxa_myGlow.jsx" with your script name)
Currently it will work only with one selected layer, if you choose multiple layers, it will give you error. I don't know how to apply function to multiple selected layers yet.