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

  • 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


πŸ”— View on Blender Artists