-
Notifications
You must be signed in to change notification settings - Fork 129
Fusion: automatic installation of PySide2 #6111
Conversation
Currently not working yet as subprocess is invoking wrong `pip` which causes issue about missing `dataclasses`.
…0_Fusion-setup-PySide2
Cannot use pip list as wrong pip from .venv is used and it was causing issue about missing dataclass (not in Python3.6). This implementation is simpler and just tries to import PySide2.
Task linked: OP-7450 Fusion: setup PySide2 |
…0_Fusion-setup-PySide2
I assume this will make the fusion launch as slow as blender launch - can we make this optional somehow. We have no need for this feature and definitely want to avoid those speed issues. Also, is there a reason we're not defaulting to PySide6? |
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Would there be really difference in running and handling But I was thinking about making this optional, I don't think we have optionality in hooks. Created an issue for that #6112. |
You could always just check a project (or system) setting inside its
Difference from what? |
Time wise difference. I am assuming that Blender might be a bit slower as it loops through all packages, but this one should be pretty fast, imho. |
I know it can run in totally different python environment than AYON is, but should we at least try to install pyside version defined by the AYON launcher/addon itself in pyproject.toml? I mean this can in theory pull in latest version of pyside for given python that might not be exactly compatible with other tools. Or am I to paranoid? |
New hook is controllable by Settings.
…thub.com/ynput/OpenPype into enhancement/OP-7450_Fusion-setup-PySide2
This approach should be more generic, not tied to specific version of PySide2
I don't think we can install same version of PySide in Python 3.6 as is for more up-to-date versions of Python. |
Note that we're not using Python 3.6 with Fusion but Python 3.9 (matching version with OP). Py3.6 is one of the supported versions - not necessarily the best version to use. ;) |
…thub.com/ynput/OpenPype into enhancement/OP-7450_Fusion-setup-PySide2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! tested on Ayon and works perfect
Because it is not "expected" python in blender but installed python, I would expect the executable is python3 on linux/macos rather than python. Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
It checks first that it would need admin privileges for installation, if not it installs headlessly. If yes, it will create separate dialog that will ask for admin privileges.
Added headless possibility of PySide2 installation in Windows if no admin privileges required. |
Also the installation is happening silently which is ok, but since it is taking some time it made me wonder what is going on, since no UX feedback was given. Shouldn't some informative message popup and say, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works as advertized
I'd personally prefer that menu entry to exist on our end - and disable the auto-install feature due to the influence it has on the startup speed for Fusion from the launcher (all the time). I'd rather have it fail to launch once inside Fusion - then make the user aware of the 'install it' instead of it continuously influencing the performance of the launch times. But maybe I just have had to deal with too many people that want applications to launch in less than a few seconds. :) |
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Yeah, the option must stay there as this hook is optional. I don't believe that this hook takes too long after pyside is installed. I couldn't find any dialog that could be thrown in Launcher during pre-launch hook, I am logging that PySide2 is being installed, but that will show up only in |
Isn't this functionality technically wrong if the application environment settings is providing a It should actually be doing the check from within the environment of the application to run, e.g. Fusion's Python environment as defined by application settings? |
If you provide PYTHONPATH with PySide, you'll probably disable the prelaunch hook. |
Changelog Description
This PR adds hook which tries to check if PySide2 is installed in Python used by Fusion and if not, it tries to install it automatically.
Additional info
This is customer requirement. Even that there is explicit (which stays there) menu option inside of Fusion, it is happening that artists will not press it.
Hook is based on Blender approach, but checking for PySide2 is simplified as there is some issue about missing
dataclass
for click in Python3.6Testing notes: