Layer folders are managed via SelectionDivider additional layer information, identified by the keys lsct or lsdk.
lsdk is used in newer Photoshop versions for deep hierarchies (6+ levels) and may cause compatibility issues with some software like ClipStudioPaint.
SelectionDividerType
Determines the folder state or position:
0: AnyOther (Unknown type)1: OpenFolder (Indicates the end of an lsct block where the folder was open)2: ClosedFolder (Indicates the end of an lsct block where the folder was closed)3: BoundingSectionDivider (Indicates the start of a layer folder)
Data Layout
If AdditionalLayerInformation.Length is $\ge 12$:
- 4 bytes:
Signature (8BIM) - 4 bytes:
BlendModeKey (ASCII-String)
If AdditionalLayerInformation.Length is $\ge 16$:
- 4 bytes:
SubType (0 = Normal, 1 = Scene Group/Animation timeline related)
// SelectionDividerType Enum values
// 0: AnyOther
// 1: OpenFolder
// 2: ClosedFolder
// 3: BoundingSectionDivider