mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge branch 'develop' into enhancement/workfiles_fix_big_margins
This commit is contained in:
commit
a97e3ee29e
8 changed files with 28 additions and 6 deletions
|
|
@ -26,6 +26,7 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook):
|
||||||
"photoshop",
|
"photoshop",
|
||||||
"tvpaint",
|
"tvpaint",
|
||||||
"substancepainter",
|
"substancepainter",
|
||||||
|
"substancedesigner",
|
||||||
"aftereffects",
|
"aftereffects",
|
||||||
"wrap",
|
"wrap",
|
||||||
"openrv",
|
"openrv",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ class OCIOEnvHook(PreLaunchHook):
|
||||||
order = 0
|
order = 0
|
||||||
hosts = {
|
hosts = {
|
||||||
"substancepainter",
|
"substancepainter",
|
||||||
|
"substancedesigner",
|
||||||
"fusion",
|
"fusion",
|
||||||
"blender",
|
"blender",
|
||||||
"aftereffects",
|
"aftereffects",
|
||||||
|
|
|
||||||
|
|
@ -708,6 +708,7 @@ def get_instance_staging_dir(instance):
|
||||||
project_settings=context.data["project_settings"],
|
project_settings=context.data["project_settings"],
|
||||||
template_data=template_data,
|
template_data=template_data,
|
||||||
always_return_path=True,
|
always_return_path=True,
|
||||||
|
username=context.data["user"],
|
||||||
)
|
)
|
||||||
|
|
||||||
staging_dir_path = staging_dir_info.directory
|
staging_dir_path = staging_dir_info.directory
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ def get_staging_dir_info(
|
||||||
logger: Optional[logging.Logger] = None,
|
logger: Optional[logging.Logger] = None,
|
||||||
prefix: Optional[str] = None,
|
prefix: Optional[str] = None,
|
||||||
suffix: Optional[str] = None,
|
suffix: Optional[str] = None,
|
||||||
|
username: Optional[str] = None,
|
||||||
) -> Optional[StagingDir]:
|
) -> Optional[StagingDir]:
|
||||||
"""Get staging dir info data.
|
"""Get staging dir info data.
|
||||||
|
|
||||||
|
|
@ -157,6 +158,7 @@ def get_staging_dir_info(
|
||||||
logger (Optional[logging.Logger]): Logger instance.
|
logger (Optional[logging.Logger]): Logger instance.
|
||||||
prefix (Optional[str]) Optional prefix for staging dir name.
|
prefix (Optional[str]) Optional prefix for staging dir name.
|
||||||
suffix (Optional[str]): Optional suffix for staging dir name.
|
suffix (Optional[str]): Optional suffix for staging dir name.
|
||||||
|
username (Optional[str]): AYON Username.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Optional[StagingDir]: Staging dir info data
|
Optional[StagingDir]: Staging dir info data
|
||||||
|
|
@ -183,7 +185,9 @@ def get_staging_dir_info(
|
||||||
|
|
||||||
# making few queries to database
|
# making few queries to database
|
||||||
ctx_data = get_template_data(
|
ctx_data = get_template_data(
|
||||||
project_entity, folder_entity, task_entity, host_name
|
project_entity, folder_entity, task_entity, host_name,
|
||||||
|
settings=project_settings,
|
||||||
|
username=username
|
||||||
)
|
)
|
||||||
|
|
||||||
# add additional data
|
# add additional data
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from ayon_core.settings import get_studio_settings
|
||||||
from ayon_core.lib.local_settings import get_ayon_username
|
from ayon_core.lib.local_settings import get_ayon_username
|
||||||
|
|
||||||
|
|
||||||
def get_general_template_data(settings=None):
|
def get_general_template_data(settings=None, username=None):
|
||||||
"""General template data based on system settings or machine.
|
"""General template data based on system settings or machine.
|
||||||
|
|
||||||
Output contains formatting keys:
|
Output contains formatting keys:
|
||||||
|
|
@ -14,17 +14,22 @@ def get_general_template_data(settings=None):
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
settings (Dict[str, Any]): Studio or project settings.
|
settings (Dict[str, Any]): Studio or project settings.
|
||||||
|
username (Optional[str]): AYON Username.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not settings:
|
if not settings:
|
||||||
settings = get_studio_settings()
|
settings = get_studio_settings()
|
||||||
|
|
||||||
|
if username is None:
|
||||||
|
username = get_ayon_username()
|
||||||
|
|
||||||
core_settings = settings["core"]
|
core_settings = settings["core"]
|
||||||
return {
|
return {
|
||||||
"studio": {
|
"studio": {
|
||||||
"name": core_settings["studio_name"],
|
"name": core_settings["studio_name"],
|
||||||
"code": core_settings["studio_code"]
|
"code": core_settings["studio_code"]
|
||||||
},
|
},
|
||||||
"user": get_ayon_username()
|
"user": username
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -145,6 +150,7 @@ def get_template_data(
|
||||||
task_entity=None,
|
task_entity=None,
|
||||||
host_name=None,
|
host_name=None,
|
||||||
settings=None,
|
settings=None,
|
||||||
|
username=None
|
||||||
):
|
):
|
||||||
"""Prepare data for templates filling from entered documents and info.
|
"""Prepare data for templates filling from entered documents and info.
|
||||||
|
|
||||||
|
|
@ -167,12 +173,13 @@ def get_template_data(
|
||||||
host_name (Optional[str]): Used to fill '{app}' key.
|
host_name (Optional[str]): Used to fill '{app}' key.
|
||||||
settings (Union[Dict, None]): Prepared studio or project settings.
|
settings (Union[Dict, None]): Prepared studio or project settings.
|
||||||
They're queried if not passed (may be slower).
|
They're queried if not passed (may be slower).
|
||||||
|
username (Optional[str]): AYON Username.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dict[str, Any]: Data prepared for filling workdir template.
|
Dict[str, Any]: Data prepared for filling workdir template.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
template_data = get_general_template_data(settings)
|
template_data = get_general_template_data(settings, username=username)
|
||||||
template_data.update(get_project_template_data(project_entity))
|
template_data.update(get_project_template_data(project_entity))
|
||||||
if folder_entity:
|
if folder_entity:
|
||||||
template_data.update(get_folder_template_data(
|
template_data.update(get_folder_template_data(
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ class CollectResourcesPath(pyblish.api.InstancePlugin):
|
||||||
"yeticacheUE",
|
"yeticacheUE",
|
||||||
"tycache",
|
"tycache",
|
||||||
"usd",
|
"usd",
|
||||||
"oxrig"
|
"oxrig",
|
||||||
|
"sbsar",
|
||||||
]
|
]
|
||||||
|
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ Enabled vs Disabled logic in most of stylesheets
|
||||||
font-family: "Noto Sans";
|
font-family: "Noto Sans";
|
||||||
font-weight: 450;
|
font-weight: 450;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
|
/* Define icon size to fix size issues for most of DCCs */
|
||||||
|
icon-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget {
|
QWidget {
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,8 @@ class FilesWidget(QtWidgets.QWidget):
|
||||||
|
|
||||||
# Initial setup
|
# Initial setup
|
||||||
workarea_btn_open.setEnabled(False)
|
workarea_btn_open.setEnabled(False)
|
||||||
|
workarea_btn_browse.setEnabled(False)
|
||||||
|
workarea_btn_save.setEnabled(False)
|
||||||
published_btn_copy_n_open.setEnabled(False)
|
published_btn_copy_n_open.setEnabled(False)
|
||||||
published_btn_change_context.setEnabled(False)
|
published_btn_change_context.setEnabled(False)
|
||||||
published_btn_cancel.setVisible(False)
|
published_btn_cancel.setVisible(False)
|
||||||
|
|
@ -278,8 +280,9 @@ class FilesWidget(QtWidgets.QWidget):
|
||||||
self._published_btn_change_context.setEnabled(enabled)
|
self._published_btn_change_context.setEnabled(enabled)
|
||||||
|
|
||||||
def _update_workarea_btns_state(self):
|
def _update_workarea_btns_state(self):
|
||||||
enabled = self._is_save_enabled
|
enabled = self._is_save_enabled and self._valid_selected_context
|
||||||
self._workarea_btn_save.setEnabled(enabled)
|
self._workarea_btn_save.setEnabled(enabled)
|
||||||
|
self._workarea_btn_browse.setEnabled(self._valid_selected_context)
|
||||||
|
|
||||||
def _on_published_repre_changed(self, event):
|
def _on_published_repre_changed(self, event):
|
||||||
self._valid_representation_id = event["representation_id"] is not None
|
self._valid_representation_id = event["representation_id"] is not None
|
||||||
|
|
@ -294,6 +297,7 @@ class FilesWidget(QtWidgets.QWidget):
|
||||||
and self._selected_task_id is not None
|
and self._selected_task_id is not None
|
||||||
)
|
)
|
||||||
self._update_published_btns_state()
|
self._update_published_btns_state()
|
||||||
|
self._update_workarea_btns_state()
|
||||||
|
|
||||||
def _on_published_save_clicked(self):
|
def _on_published_save_clicked(self):
|
||||||
result = self._exec_save_as_dialog()
|
result = self._exec_save_as_dialog()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue