Integrating latest 47acbe8
This commit is contained in:
@@ -11,40 +11,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import pathlib
|
||||
import azlmbr
|
||||
import azlmbr.bus
|
||||
|
||||
# establishes python paths to find PySide2 libraries
|
||||
if (azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, 'IsActive')):
|
||||
|
||||
params = azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, 'GetQtBootstrapParameters')
|
||||
|
||||
# add PySide2 base folder to sys.path
|
||||
# Ideally, the current directory or the directory of the script is the first
|
||||
# always the first element: https://tinyurl.com/yysfw8pb
|
||||
sys.path.insert(1, pathlib.PureWindowsPath(params.pySidePackageFolder).as_posix())
|
||||
sys.path.insert(1, pathlib.PureWindowsPath(params.qtBinaryFolder).as_posix())
|
||||
params = azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, 'GetQtBootstrapParameters')
|
||||
|
||||
if len(params.qtPluginsFolder):
|
||||
# add the Qt plugins to the environment
|
||||
os.environ['QT_PLUGIN_PATH'] = params.qtPluginsFolder
|
||||
|
||||
# add Qt binaries to the Windows path to handle findings DLL file dependencies
|
||||
if sys.platform.startswith('win'):
|
||||
path = os.environ['PATH']
|
||||
newPath = ''
|
||||
newPath += params.qtBinaryFolder + os.pathsep
|
||||
newPath += os.path.join(params.pySidePackageFolder, 'shiboken2') + os.pathsep
|
||||
newPath += os.path.join(params.pySidePackageFolder, 'PySide2') + os.pathsep
|
||||
newPath += path
|
||||
os.environ['PATH'] = newPath
|
||||
print('PySide2 bootstrapped PATH for Windows.')
|
||||
# add Qt binaries to the Windows path to handle findings DLL file dependencies
|
||||
if len(params.qtBinaryFolder) and sys.platform.startswith('win'):
|
||||
path = os.environ['PATH']
|
||||
newPath = ''
|
||||
newPath += params.qtBinaryFolder + os.pathsep
|
||||
newPath += path
|
||||
os.environ['PATH'] = newPath
|
||||
print('PySide2 bootstrapped PATH for Windows.')
|
||||
|
||||
# Once PySide2 has been bootstrapped, register our Object Tree visualizer with the Editor
|
||||
try:
|
||||
import az_qt_helpers
|
||||
from show_object_tree import ObjectTreeDialog
|
||||
az_qt_helpers.register_view_pane('Object Tree', ObjectTreeDialog)
|
||||
except:
|
||||
print ('Skipping register our Object Tree visualizer with the Editor.')
|
||||
# Once PySide2 has been bootstrapped, register our Object Tree visualizer with the Editor
|
||||
try:
|
||||
import az_qt_helpers
|
||||
from show_object_tree import ObjectTreeDialog
|
||||
az_qt_helpers.register_view_pane('Object Tree', ObjectTreeDialog)
|
||||
except:
|
||||
print('Skipping register our Object Tree visualizer with the Editor.')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user