Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. How do i collapse a layerset?

The layersets as it should be: only Diffuse should be expanded

like image 564
Nique Avatar asked Sep 12 '15 14:09

Nique


2 Answers

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);
like image 138
Vlad Moyseenko Avatar answered Nov 08 '22 13:11

Vlad Moyseenko


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!

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.

There is a work around solution : but you'll have to search for it

like image 1
Mr Mystery Guest Avatar answered Nov 08 '22 13:11

Mr Mystery Guest