Skip to content

Instantly share code, notes, and snippets.

@lampysprites
Last active January 12, 2023 04:32
Show Gist options
  • Save lampysprites/ef7511e47eb1855c6869c03bca0a8e6d to your computer and use it in GitHub Desktop.
Save lampysprites/ef7511e47eb1855c6869c03bca0a8e6d to your computer and use it in GitHub Desktop.
Add Armory run button to blender top panel
## armory/blender/arm/props_ui.py
def draw_space_topbar(self, context):
box = self.layout.row(align=True)
if state.proc_play is None and state.proc_build is None:
box.operator("arm.play", icon="PLAY", text="")
else:
box.operator("arm.stop", icon="MESH_PLANE", text="")
box.operator("arm.open_editor", icon="DESKTOP", text="")
box.operator("arm.open_project_folder", icon="FILE_FOLDER", text="")
box.popover(panel="ARM_PT_ArmoryPlayerPanel", text="")
## in register()
bpy.types.TOPBAR_HT_upper_bar.append(draw_space_topbar)
@lampysprites
Copy link
Author

*needs admin permissions on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment