Post #4744: Regarding the PME stack key function, I added these two lines of code in each of
📋 Metadata
- Author: lee_blues
- Date: 2023-06-10 02:40:16
- Type:
question - Quality Score: 7/10
- Replies (1): post_04745
🏷️ Tags
pie-menu hotkeys intermediate unsolved
⚙️ Related PME Features
- Stack Key Editor
- Python Scripting
- Pie Menu Editor
💬 Content
Regarding the PME stack key function, I added these two lines of code in each of the two columns as a toggle
C.space_data.shading.light = ‘MATCAP’
C.space_data.shading.light = ‘STUDIO’

Actually the actual code is:
if C.space_data.shading.light == 'STUDIO':
C.space_data.shading.light = 'MATCAP'
elif C.space_data.shading.light == 'MATCAP':
C.space_data.shading.light = 'STUDIO'
So sometimes it should to execute from the first column, sometimes from the second column, the remember state function can not completely solve this problem, whether it can be added code to the check the current context, if so how to write the code?
@Pluglug