space_statusbar.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # ##### BEGIN GPL LICENSE BLOCK #####
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # ##### END GPL LICENSE BLOCK #####
  18. # <pep8 compliant>
  19. from bpy.types import Header
  20. class STATUSBAR_HT_header(Header):
  21. bl_space_type = 'STATUSBAR'
  22. def draw(self, context):
  23. layout = self.layout
  24. # input status
  25. layout.template_input_status()
  26. layout.separator_spacer()
  27. # messages
  28. layout.template_reports_banner()
  29. layout.template_running_jobs()
  30. layout.separator_spacer()
  31. # stats
  32. scene = context.scene
  33. view_layer = context.view_layer
  34. layout.label(text=scene.statistics(view_layer), translate=False)
  35. classes = (
  36. STATUSBAR_HT_header,
  37. )
  38. if __name__ == "__main__": # only for live edit.
  39. from bpy.utils import register_class
  40. for cls in classes:
  41. register_class(cls)