Post #1331: ![](https://blenderartists.org/user_avatar/blenderartists.org/mickhanks/48/77779

📋 Metadata

  • Author: Way2Close
  • Date: 2018-04-20 16:17:00
  • Type: answer
  • Quality Score: 7/10
  • Reply to: post_01330

🏷️ Tags

macro configuration intermediate

  • Macro Editor
  • Python Scripting

💬 Content

MickHanks:

Way2Close and roaoao.

Thanks I give it a try. is elif sort for else if?

Yes lol, it didnt paste it right, the lines should be indented:

if bpy.context.space_data.tree_type == 'ShaderNodeTree':
    open_menu("menu_1") 
elif bpy.context.space_data.tree_type == 'CompositorNodeTree':
    open_menu("menu_2") 
elif bpy.context.space_data.tree_type == 'TextureNodeTree':
    open_menu("menu_3")

🔗 View on Blender Artists