bootstrap.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. import sys
  7. import os
  8. import azlmbr
  9. import azlmbr.bus
  10. params = azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, 'GetQtBootstrapParameters')
  11. if len(params.qtPluginsFolder):
  12. # add the Qt plugins to the environment
  13. os.environ['QT_PLUGIN_PATH'] = params.qtPluginsFolder
  14. # add Qt binaries to the Windows path to handle findings DLL file dependencies
  15. if len(params.qtBinaryFolder) and sys.platform.startswith('win'):
  16. path = os.environ['PATH']
  17. newPath = ''
  18. newPath += params.qtBinaryFolder + os.pathsep
  19. newPath += path
  20. os.environ['PATH'] = newPath
  21. print('PySide2 bootstrapped PATH for Windows.')
  22. # Once PySide2 has been bootstrapped, register our Object Tree visualizer with the Editor
  23. try:
  24. import az_qt_helpers
  25. from show_object_tree import ObjectTreeDialog
  26. az_qt_helpers.register_view_pane('Object Tree', ObjectTreeDialog)
  27. except:
  28. print('Skipping register our Object Tree visualizer with the Editor.')