pre_install_pyside
Pre-launch hook for installing Qt bindings in Marvelous Designer.
This module provides: - InstallQtBinding: Pre-launch hook that installs PySide6 to MD's Python environment to enable Qt-based functionality.
InstallQtBinding
Bases: PreLaunchHook
Install Qt binding to unreal's python packages.
Source code in client/ayon_marvelousdesigner/hooks/pre_install_pyside.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
execute()
Execute the pre-launch hook to install PySide6.
Source code in client/ayon_marvelousdesigner/hooks/pre_install_pyside.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
install_pyside(python_executable, qt_binding_dir)
Install PySide6 python module to marvelous designer's python.
Installation requires administration rights that's why it is required to use "pywin32" module which can execute command's and ask for administration rights.
Note
This is asking for administrative right always, no matter if it is actually needed or not. Unfortunately getting correct permissions for directory on Windows isn't that trivial. You can either use win32security module or run icacls command in subprocess and parse its output.
Returns:
| Type | Description |
|---|---|
Union[int, None] | Return code from the pip install process, or None |
Union[int, None] | if installation fails. |
Source code in client/ayon_marvelousdesigner/hooks/pre_install_pyside.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
pip_install(args)
Execute pip install command in subprocess.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args | list | List of command line arguments for pip install. | required |
Returns:
| Type | Description |
|---|---|
Union[int, None] | bool or None: True if pip install was successful (return code 0), |
Union[int, None] | None if an exception occurred during execution. |
Source code in client/ayon_marvelousdesigner/hooks/pre_install_pyside.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |