bootstrap.py 1.2 KB

12345678910111213141516171819202122232425262728
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. # -------------------------------------------------------------------------
  7. """${SanitizedCppName}\\editor\\scripts\\boostrap.py
  8. Generated from O3DE PythonToolGem Template"""
  9. import az_qt_helpers
  10. from ${SanitizedNameLower}_dialog import ${SanitizedCppName}Dialog
  11. if __name__ == "__main__":
  12. print("${SanitizedCppName}.boostrap, Generated from O3DE PythonToolGem Template")
  13. try:
  14. import azlmbr.editor as editor
  15. # Register our custom widget as a dockable tool with the Editor under an Examples sub-menu
  16. options = editor.ViewPaneOptions()
  17. options.showOnToolsToolbar = True
  18. options.toolbarIcon = ":/${Name}/toolbar_icon.svg"
  19. az_qt_helpers.register_view_pane('${SanitizedCppName}', ${SanitizedCppName}Dialog, category="Examples", options=options)
  20. except:
  21. # If the editor is not available (in the cases where this gem is activated outside of the Editor), then just
  22. # report it and continue.
  23. print(f'Skipping registering view pane ${SanitizedCppName}, Editor is not available.')