Add API to Expand/Collapse Layer Groups in the Layer Stack
Description:
Currently, the Substance 3D Painter JavaScript (and Python) APIs provide access to layer stack data such as creating, renaming, moving, hiding, and selecting layers and groups. However, there is no exposed function to control the UI expand/collapse state (the chevrons) of groups (folders) in the Layer Stack.
Steps to Reproduce Limitation:
Open a project with multiple groups/folders in the Layer Stack.
Use the JavaScript API (alg.layerstack, alg.texturesets, mapexport.documentStructure, etc.) to iterate and manipulate layers.
Attempt to programmatically expand or collapse groups → no API is available to do this.
Why this is important:
In projects with many nested groups, manually expanding/collapsing them is time-consuming.
Plugin developers could create useful tools to quickly expand or collapse all groups within a selected texture set, helping artists manage complex stacks.
Improves usability and productivity by reducing repetitive manual UI interactions.
Similar to how APIs allow selecting nodes or toggling visibility, being able to control group expansion would make custom UI plugins more powerful.
Requested Feature:
Expose a function in the API such as:
alg.layerstack.setGroupExpanded(node, true/false);
or
layerstack.setExpanded(groupNode, expanded=True/False)
Benefit:
This small addition would allow plugin developers to build workflow enhancers (like “Expand all groups” or “Collapse all groups” buttons) and improve navigation in large projects.
