Fusion: automatic installation of PySide2 (#6111)

* OP-7450 - WIP of new hook to install PySide2

Currently not working yet as subprocess is invoking wrong `pip` which causes issue about missing `dataclasses`.

* OP-7450 - updates querying of PySide2 presence

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.

* OP-7450 - typo

* OP-7450 - removed forgotten raise for debugging

* OP-7450 - double quotes

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

* OP-7450 - return if error

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

* OP-7450 - return False

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

* OP-7450 - added optionality for InstallPySideToFusion

New hook is controllable by Settings.

* OP-7450 - updated querying of Qt

This approach should be more generic, not tied to specific version of PySide2

* OP-7450 - fix unwanted change

* OP-7450 - added settings for legacy OP

* OP-7450 - use correct python executable name in Linux

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>

* OP-7450 - headless installation in Windows

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.

* OP-7450 - Hound

* Update openpype/hosts/fusion/hooks/pre_pyside_install.py

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

---------

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Petr Kalis 2024-01-10 17:10:52 +01:00 committed by GitHub
parent b3d5223e9c
commit 399bb404c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 253 additions and 15 deletions

View file

@ -25,16 +25,6 @@ def _create_saver_instance_attributes_enum():
]
def _image_format_enum():
return [
{"value": "exr", "label": "exr"},
{"value": "tga", "label": "tga"},
{"value": "png", "label": "png"},
{"value": "tif", "label": "tif"},
{"value": "jpg", "label": "jpg"},
]
class CreateSaverPluginModel(BaseSettingsModel):
_isGroup = True
temp_rendering_path_template: str = Field(
@ -49,9 +39,23 @@ class CreateSaverPluginModel(BaseSettingsModel):
enum_resolver=_create_saver_instance_attributes_enum,
title="Instance attributes"
)
image_format: str = Field(
enum_resolver=_image_format_enum,
title="Output Image Format"
output_formats: list[str] = Field(
default_factory=list,
title="Output formats"
)
class HookOptionalModel(BaseSettingsModel):
enabled: bool = Field(
True,
title="Enabled"
)
class HooksModel(BaseSettingsModel):
InstallPySideToFusion: HookOptionalModel = Field(
default_factory=HookOptionalModel,
title="Install PySide2"
)
@ -71,6 +75,10 @@ class FusionSettings(BaseSettingsModel):
default_factory=CopyFusionSettingsModel,
title="Local Fusion profile settings"
)
hooks: HooksModel = Field(
default_factory=HooksModel,
title="Hooks"
)
create: CreatPluginsModel = Field(
default_factory=CreatPluginsModel,
title="Creator plugins"
@ -93,6 +101,11 @@ DEFAULT_VALUES = {
"copy_status": False,
"force_sync": False
},
"hooks": {
"InstallPySideToFusion": {
"enabled": True
}
},
"create": {
"CreateSaver": {
"temp_rendering_path_template": "{workdir}/renders/fusion/{product[name]}/{product[name]}.{frame}.{ext}",
@ -104,7 +117,15 @@ DEFAULT_VALUES = {
"reviewable",
"farm_rendering"
],
"image_format": "exr"
"output_formats": [
"exr",
"jpg",
"jpeg",
"jpg",
"tiff",
"png",
"tga"
]
}
}
}

View file

@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"