mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge branch 'develop' into enhancement/houdini_py310
This commit is contained in:
commit
7fa44ef4c8
11 changed files with 181 additions and 16 deletions
|
|
@ -1,4 +1,7 @@
|
|||
import collections
|
||||
import json
|
||||
|
||||
import six
|
||||
from ayon_api.graphql import GraphQlQuery, FIELD_VALUE, fields_to_dict
|
||||
|
||||
from .constants import DEFAULT_FOLDER_FIELDS
|
||||
|
|
@ -84,12 +87,12 @@ def get_folders_with_tasks(
|
|||
for folder. All possible folder fields are returned if 'None'
|
||||
is passed.
|
||||
|
||||
Returns:
|
||||
List[Dict[str, Any]]: Queried folder entities.
|
||||
Yields:
|
||||
Dict[str, Any]: Queried folder entities.
|
||||
"""
|
||||
|
||||
if not project_name:
|
||||
return []
|
||||
return
|
||||
|
||||
filters = {
|
||||
"projectName": project_name
|
||||
|
|
@ -97,25 +100,25 @@ def get_folders_with_tasks(
|
|||
if folder_ids is not None:
|
||||
folder_ids = set(folder_ids)
|
||||
if not folder_ids:
|
||||
return []
|
||||
return
|
||||
filters["folderIds"] = list(folder_ids)
|
||||
|
||||
if folder_paths is not None:
|
||||
folder_paths = set(folder_paths)
|
||||
if not folder_paths:
|
||||
return []
|
||||
return
|
||||
filters["folderPaths"] = list(folder_paths)
|
||||
|
||||
if folder_names is not None:
|
||||
folder_names = set(folder_names)
|
||||
if not folder_names:
|
||||
return []
|
||||
return
|
||||
filters["folderNames"] = list(folder_names)
|
||||
|
||||
if parent_ids is not None:
|
||||
parent_ids = set(parent_ids)
|
||||
if not parent_ids:
|
||||
return []
|
||||
return
|
||||
if None in parent_ids:
|
||||
# Replace 'None' with '"root"' which is used during GraphQl
|
||||
# query for parent ids filter for folders without folder
|
||||
|
|
@ -147,10 +150,10 @@ def get_folders_with_tasks(
|
|||
|
||||
parsed_data = query.query(con)
|
||||
folders = parsed_data["project"]["folders"]
|
||||
if active is None:
|
||||
return folders
|
||||
return [
|
||||
folder
|
||||
for folder in folders
|
||||
if folder["active"] is active
|
||||
]
|
||||
for folder in folders:
|
||||
if active is not None and folder["active"] is not active:
|
||||
continue
|
||||
folder_data = folder.get("data")
|
||||
if isinstance(folder_data, six.string_types):
|
||||
folder["data"] = json.loads(folder_data)
|
||||
yield folder
|
||||
|
|
|
|||
|
|
@ -170,7 +170,8 @@ class SubstanceHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
|
|||
|
||||
parent = substance_painter.ui.get_main_window()
|
||||
|
||||
menu = QtWidgets.QMenu("OpenPype")
|
||||
tab_menu_label = os.environ.get("AVALON_LABEL") or "AYON"
|
||||
menu = QtWidgets.QMenu(tab_menu_label)
|
||||
|
||||
action = menu.addAction("Create...")
|
||||
action.triggered.connect(
|
||||
|
|
|
|||
|
|
@ -940,6 +940,23 @@ def _convert_photoshop_project_settings(ayon_settings, output):
|
|||
output["photoshop"] = ayon_photoshop
|
||||
|
||||
|
||||
def _convert_substancepainter_project_settings(ayon_settings, output):
|
||||
if "substancepainter" not in ayon_settings:
|
||||
return
|
||||
|
||||
ayon_substance_painter = ayon_settings["substancepainter"]
|
||||
_convert_host_imageio(ayon_substance_painter)
|
||||
if "shelves" in ayon_substance_painter:
|
||||
shelves_items = ayon_substance_painter["shelves"]
|
||||
new_shelves_items = {
|
||||
item["name"]: item["value"]
|
||||
for item in shelves_items
|
||||
}
|
||||
ayon_substance_painter["shelves"] = new_shelves_items
|
||||
|
||||
output["substancepainter"] = ayon_substance_painter
|
||||
|
||||
|
||||
def _convert_tvpaint_project_settings(ayon_settings, output):
|
||||
if "tvpaint" not in ayon_settings:
|
||||
return
|
||||
|
|
@ -1398,6 +1415,7 @@ def convert_project_settings(ayon_settings, default_settings):
|
|||
_convert_nuke_project_settings(ayon_settings, output)
|
||||
_convert_hiero_project_settings(ayon_settings, output)
|
||||
_convert_photoshop_project_settings(ayon_settings, output)
|
||||
_convert_substancepainter_project_settings(ayon_settings, output)
|
||||
_convert_tvpaint_project_settings(ayon_settings, output)
|
||||
_convert_traypublisher_project_settings(ayon_settings, output)
|
||||
_convert_webpublisher_project_settings(ayon_settings, output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue