简体   繁体   English

在 Extendscript 中折叠或展开图层集

[英]Collapse or Expand a Layerset in Extendscript

I created a extendscript that automatically creates layersets for asset textures for a game.我创建了一个扩展脚本,它会自动为游戏的资产纹理创建层集。

After creating a layerset, the set is expanded by default.创建图层集后,该集默认展开。 I want the layerset to be collapsed as shown in the picture below.我希望图层集如下图所示折叠。 I leave only the Diffuse layer to be expanded.我只留下要展开的漫反射层。 The rest is closed.其余关闭。 I've searched the reference by Adobe on how to do this but couldn't find anything.我已经搜索了 Adob​​e 提供的有关如何执行此操作的参考,但找不到任何内容。 How do i collapse a layerset?如何折叠图层集?

应该是的图层集:只应该扩展漫反射

There is no way to do this via scripting (I've looked into this before).没有办法通过脚本来做到这一点(我之前已经研究过)。 There simply is no collapse (or equivalent) layerSets property to set!根本没有要设置的折叠(或等效) layerSets属性!

However, what you can do is press CTRL (or Command on Mac) and click on the little arrow next to the group (in the layers window) - which will collapse all the groups for you.但是,您可以按 CTRL(或 Mac 上的 Command)并单击组旁边的小箭头(在图层窗口中) - 这将为您折叠所有组。

There is a work around solution : but you'll have to search for it有一个解决方案:但你必须搜索它

As Mr Mystery Guest said, unfortunately you can't collapse a particular group, but you can collapse all the groups.正如神秘客人先生所说,不幸的是,您无法折叠特定组,但可以折叠所有组。

The link from the accepted answer is dead, so I will post here a solution:已接受答案的链接已失效,因此我将在此处发布解决方案:

var idcollapseAllGroupsEvent = stringIDToTypeID("collapseAllGroupsEvent");
var desc = new ActionDescriptor();
executeAction(idcollapseAllGroupsEvent, desc, DialogModes.NO);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM