Post #2121: recently i saw an addon for changing colors of topbar depending on the mode you

📋 Metadata

  • Author: draguu
  • Date: 2019-03-27 07:26:50
  • Type: question
  • Quality Score: 5/10
  • Replies (1): post_02122

🏷️ Tags

macro stack-key modal scripting beginner

  • Macro Editor
  • Stack Key Editor
  • Modal Editor
  • Python Scripting

💬 Content

recently i saw an addon for changing colors of topbar depending on the mode you are in ,

i tried to replicate same with pme , and i got this ,

import bpy
if  bpy.context.scene.tool_settings.use_keyframe_insert_auto == True:
    
    bpy.context.preferences.themes['Default'].topbar.space.header= [1,1,0,1]

else:
    bpy.context.preferences.themes['Default'].topbar.space.header= [1,0,0,1]

now i dont understand is , where should i add this code? as a macro ? or as a stack key or as a modal operator ,
let me know what do you think


🔗 View on Blender Artists