Post #2122: One way is creating a PME prop:
π Metadata
- Author: iceythe
- Date: 2019-03-27 14:55:00
- Type:
answer - Quality Score: 9/10
- Reply to: post_02121
π·οΈ Tags
pie-menu hotkeys advanced solved
βοΈ Related PME Features
- Property Editor
- Python Scripting
- Pie Menu Editor
π¬ Content
One way is creating a PME prop:
1 Add a Property - call it autokey or something. Show advanced settings.
2 Getter:
return C.scene.tool_settings.use_keyframe_insert_auto
3 Setter:
C.scene.tool_settings.use_keyframe_insert_auto = value
4 On Update:
h = C.preferences.themes['Default'].topbar.space.header; h[:] = [1,1,0,1] if props().autokey else [1,0,0,1]
5 On Init:
# Same code as On Update
You then need to toggle this prop for the On Update function to trigger. Using the default button in the UI wonβt work.
You can access the prop as props().autokey and use it anywhere in the PME menus
Edit:
Or you can use this in On Update to get the default header color on startup:
h = C.preferences.themes['Default'].topbar.space.header; h[:] = (0.137254, 0.137254, 0.137254, 1.0)
β€οΈ 1 likes