mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge branch 'develop' into enhancement/OP-3149_Publisher-UI-modifications
This commit is contained in:
commit
0161e3ddbb
48 changed files with 800 additions and 1061 deletions
|
|
@ -127,12 +127,6 @@ class BaseItemEntity(BaseEntity):
|
|||
# Entity is in hierarchy of dynamically created entity
|
||||
self.is_in_dynamic_item = False
|
||||
|
||||
# Entity will save metadata about environments
|
||||
# - this is current possible only for RawJsonEnity
|
||||
self.is_env_group = False
|
||||
# Key of environment group key must be unique across system settings
|
||||
self.env_group_key = None
|
||||
|
||||
# Roles of an entity
|
||||
self.roles = None
|
||||
|
||||
|
|
@ -286,16 +280,6 @@ class BaseItemEntity(BaseEntity):
|
|||
).format(self.group_item.path)
|
||||
raise EntitySchemaError(self, reason)
|
||||
|
||||
# Validate that env group entities will be stored into file.
|
||||
# - env group entities must store metadata which is not possible if
|
||||
# metadata would be outside of file
|
||||
if self.file_item is None and self.is_env_group:
|
||||
reason = (
|
||||
"Environment item is not inside file"
|
||||
" item so can't store metadata for defaults."
|
||||
)
|
||||
raise EntitySchemaError(self, reason)
|
||||
|
||||
# Dynamic items must not have defined labels. (UI specific)
|
||||
if self.label and self.is_dynamic_item:
|
||||
raise EntitySchemaError(
|
||||
|
|
@ -862,11 +846,6 @@ class ItemEntity(BaseItemEntity):
|
|||
if self.is_dynamic_item:
|
||||
self.require_key = False
|
||||
|
||||
# If value should be stored to environments and uder which group key
|
||||
# - the key may be dynamically changed by it's parent on save
|
||||
self.env_group_key = self.schema_data.get("env_group_key")
|
||||
self.is_env_group = bool(self.env_group_key is not None)
|
||||
|
||||
# Root item reference
|
||||
self.root_item = self.parent.root_item
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ from .exceptions import (
|
|||
from openpype.settings.constants import (
|
||||
METADATA_KEYS,
|
||||
M_DYNAMIC_KEY_LABEL,
|
||||
M_ENVIRONMENT_KEY,
|
||||
KEY_REGEX,
|
||||
KEY_ALLOWED_SYMBOLS
|
||||
)
|
||||
|
|
@ -148,11 +147,7 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
):
|
||||
raise InvalidKeySymbols(self.path, key)
|
||||
|
||||
if self.value_is_env_group:
|
||||
item_schema = copy.deepcopy(self.item_schema)
|
||||
item_schema["env_group_key"] = key
|
||||
else:
|
||||
item_schema = self.item_schema
|
||||
item_schema = self.item_schema
|
||||
|
||||
new_child = self.create_schema_object(item_schema, self, True)
|
||||
self.children_by_key[key] = new_child
|
||||
|
|
@ -216,9 +211,7 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
self.children_label_by_id = {}
|
||||
|
||||
self.store_as_list = self.schema_data.get("store_as_list") or False
|
||||
self.value_is_env_group = (
|
||||
self.schema_data.get("value_is_env_group") or False
|
||||
)
|
||||
|
||||
self.required_keys = self.schema_data.get("required_keys") or []
|
||||
self.collapsible_key = self.schema_data.get("collapsible_key") or False
|
||||
# GUI attributes
|
||||
|
|
@ -241,9 +234,6 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
object_type.update(input_modifiers)
|
||||
self.item_schema = object_type
|
||||
|
||||
if self.value_is_env_group:
|
||||
self.item_schema["env_group_key"] = ""
|
||||
|
||||
if self.group_item is None:
|
||||
self.is_group = True
|
||||
|
||||
|
|
@ -259,10 +249,6 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
if used_temp_label:
|
||||
self.label = None
|
||||
|
||||
if self.value_is_env_group and self.store_as_list:
|
||||
reason = "Item can't store environments metadata to list output."
|
||||
raise EntitySchemaError(self, reason)
|
||||
|
||||
if not self.schema_data.get("object_type"):
|
||||
reason = (
|
||||
"Modifiable dictionary must have specified `object_type`."
|
||||
|
|
@ -579,18 +565,10 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
output.append([key, child_value])
|
||||
return output
|
||||
|
||||
output = {}
|
||||
for key, child_entity in self.children_by_key.items():
|
||||
child_value = child_entity.settings_value()
|
||||
# TODO child should have setter of env group key se child can
|
||||
# know what env group represents.
|
||||
if self.value_is_env_group:
|
||||
if key not in child_value[M_ENVIRONMENT_KEY]:
|
||||
_metadata = child_value[M_ENVIRONMENT_KEY]
|
||||
_m_keykey = tuple(_metadata.keys())[0]
|
||||
env_keys = child_value[M_ENVIRONMENT_KEY].pop(_m_keykey)
|
||||
child_value[M_ENVIRONMENT_KEY][key] = env_keys
|
||||
output[key] = child_value
|
||||
output = {
|
||||
key: child_entity.settings_value()
|
||||
for key, child_entity in self.children_by_key.items()
|
||||
}
|
||||
output.update(self.metadata)
|
||||
return output
|
||||
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@ from .exceptions import (
|
|||
EntitySchemaError
|
||||
)
|
||||
|
||||
from openpype.settings.constants import (
|
||||
METADATA_KEYS,
|
||||
M_ENVIRONMENT_KEY
|
||||
)
|
||||
from openpype.settings.constants import METADATA_KEYS
|
||||
|
||||
|
||||
class EndpointEntity(ItemEntity):
|
||||
|
|
@ -534,13 +531,7 @@ class RawJsonEntity(InputEntity):
|
|||
|
||||
@property
|
||||
def metadata(self):
|
||||
output = {}
|
||||
if isinstance(self._current_value, dict) and self.is_env_group:
|
||||
output[M_ENVIRONMENT_KEY] = {
|
||||
self.env_group_key: list(self._current_value.keys())
|
||||
}
|
||||
|
||||
return output
|
||||
return {}
|
||||
|
||||
@property
|
||||
def has_unsaved_changes(self):
|
||||
|
|
@ -549,15 +540,6 @@ class RawJsonEntity(InputEntity):
|
|||
result = self.metadata != self._metadata_for_current_state()
|
||||
return result
|
||||
|
||||
def schema_validations(self):
|
||||
if self.store_as_string and self.is_env_group:
|
||||
reason = (
|
||||
"RawJson entity can't store environment group metadata"
|
||||
" as string."
|
||||
)
|
||||
raise EntitySchemaError(self, reason)
|
||||
super(RawJsonEntity, self).schema_validations()
|
||||
|
||||
def _convert_to_valid_type(self, value):
|
||||
if isinstance(value, STRING_TYPE):
|
||||
try:
|
||||
|
|
@ -583,9 +565,6 @@ class RawJsonEntity(InputEntity):
|
|||
|
||||
def _settings_value(self):
|
||||
value = super(RawJsonEntity, self)._settings_value()
|
||||
if self.is_env_group and isinstance(value, dict):
|
||||
value.update(self.metadata)
|
||||
|
||||
if self.store_as_string:
|
||||
return json.dumps(value)
|
||||
return value
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ from openpype.settings.lib import (
|
|||
get_available_studio_project_settings_overrides_versions,
|
||||
get_available_studio_project_anatomy_overrides_versions,
|
||||
|
||||
find_environments,
|
||||
apply_overrides
|
||||
)
|
||||
|
||||
|
|
@ -422,11 +421,6 @@ class RootEntity(BaseItemEntity):
|
|||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def _validate_defaults_to_save(self, value):
|
||||
"""Validate default values before save."""
|
||||
pass
|
||||
|
||||
def _save_default_values(self):
|
||||
"""Save default values.
|
||||
|
||||
|
|
@ -435,7 +429,6 @@ class RootEntity(BaseItemEntity):
|
|||
DEFAULTS.
|
||||
"""
|
||||
settings_value = self.settings_value()
|
||||
self._validate_defaults_to_save(settings_value)
|
||||
|
||||
defaults_dir = self.defaults_dir()
|
||||
for file_path, value in settings_value.items():
|
||||
|
|
@ -604,8 +597,6 @@ class SystemSettings(RootEntity):
|
|||
def _save_studio_values(self):
|
||||
settings_value = self.settings_value()
|
||||
|
||||
self._validate_duplicated_env_group(settings_value)
|
||||
|
||||
self.log.debug("Saving system settings: {}".format(
|
||||
json.dumps(settings_value, indent=4)
|
||||
))
|
||||
|
|
@ -613,29 +604,6 @@ class SystemSettings(RootEntity):
|
|||
# Reset source version after restart
|
||||
self._source_version = None
|
||||
|
||||
def _validate_defaults_to_save(self, value):
|
||||
"""Valiations of default values before save."""
|
||||
self._validate_duplicated_env_group(value)
|
||||
|
||||
def _validate_duplicated_env_group(self, value, override_state=None):
|
||||
""" Validate duplicated environment groups.
|
||||
|
||||
Raises:
|
||||
DuplicatedEnvGroups: When value contain duplicated env groups.
|
||||
"""
|
||||
value = copy.deepcopy(value)
|
||||
if override_state is None:
|
||||
override_state = self._override_state
|
||||
|
||||
if override_state is OverrideState.STUDIO:
|
||||
default_values = get_default_settings()[SYSTEM_SETTINGS_KEY]
|
||||
final_value = apply_overrides(default_values, value)
|
||||
else:
|
||||
final_value = value
|
||||
|
||||
# Check if final_value contain duplicated environment groups
|
||||
find_environments(final_value)
|
||||
|
||||
def _save_project_values(self):
|
||||
"""System settings can't have project overrides.
|
||||
|
||||
|
|
@ -911,10 +879,6 @@ class ProjectSettings(RootEntity):
|
|||
if warnings:
|
||||
raise SaveWarningExc(warnings)
|
||||
|
||||
def _validate_defaults_to_save(self, value):
|
||||
"""Valiations of default values before save."""
|
||||
pass
|
||||
|
||||
def _validate_values_to_save(self, value):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@
|
|||
}, {
|
||||
"type": "raw-json",
|
||||
"label": "{host_label} Environments",
|
||||
"key": "{host_name}_environments",
|
||||
"env_group_key": "{host_name}"
|
||||
"key": "{host_name}_environments"
|
||||
}, {
|
||||
"type": "path",
|
||||
"key": "{host_name}_executables",
|
||||
|
|
|
|||
|
|
@ -238,25 +238,19 @@
|
|||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"key": "ext",
|
||||
"label": "Output extension",
|
||||
"type": "text"
|
||||
"type": "boolean",
|
||||
"key": "active",
|
||||
"label": "Is active",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"key": "xml_preset_file",
|
||||
"label": "XML preset file (with ext)",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"key": "xml_preset_dir",
|
||||
"label": "XML preset folder (optional)",
|
||||
"type": "text"
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"key": "export_type",
|
||||
"label": "Eport clip type",
|
||||
"type": "enum",
|
||||
"default": "File Sequence",
|
||||
"default": "Sequence Publish",
|
||||
"enum_items": [
|
||||
{
|
||||
"Movie": "Movie"
|
||||
|
|
@ -268,59 +262,125 @@
|
|||
"Sequence Publish": "Sequence Publish"
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
"key": "ext",
|
||||
"label": "Output extension",
|
||||
"type": "text",
|
||||
"default": "exr"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "ignore_comment_attrs",
|
||||
"label": "Ignore attributes parsed from a segment comments"
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
"key": "xml_preset_file",
|
||||
"label": "XML preset file (with ext)",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"key": "colorspace_out",
|
||||
"label": "Output color (imageio)",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "representation_add_range",
|
||||
"label": "Add frame range to representation"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"key": "representation_tags",
|
||||
"label": "Add representation tags",
|
||||
"object_type": {
|
||||
"type": "text",
|
||||
"multiline": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "load_to_batch_group",
|
||||
"label": "Load to batch group reel",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "batch_group_loader_name",
|
||||
"label": "Use loader name"
|
||||
"default": "linear"
|
||||
},
|
||||
{
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Other parameters",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"key": "xml_preset_dir",
|
||||
"label": "XML preset folder (optional)",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "parsed_comment_attrs",
|
||||
"label": "Include parsed attributes from comments",
|
||||
"default": false
|
||||
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Representation",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "representation_add_range",
|
||||
"label": "Add frame range to representation"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"key": "representation_tags",
|
||||
"label": "Add representation tags",
|
||||
"object_type": {
|
||||
"type": "text",
|
||||
"multiline": false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Loading during publish",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "load_to_batch_group",
|
||||
"label": "Load to batch group reel",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "batch_group_loader_name",
|
||||
"label": "Use loader name"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Filtering",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"key": "filter_path_regex",
|
||||
"label": "Regex in clip path",
|
||||
"type": "text",
|
||||
"default": ".*"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "dict",
|
||||
"collapsible": true,
|
||||
"key": "IntegrateBatchGroup",
|
||||
"label": "IntegrateBatchGroup",
|
||||
"is_group": true,
|
||||
"checkbox_key": "enabled",
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "enabled",
|
||||
"label": "Enabled"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@
|
|||
{
|
||||
"key": "requiredNodes",
|
||||
"type": "list",
|
||||
"label": "Required Nodes",
|
||||
"label": "Plugin required",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
|
|
@ -272,35 +272,43 @@
|
|||
"label": "Nuke Node Class"
|
||||
},
|
||||
{
|
||||
"type": "splitter"
|
||||
},
|
||||
{
|
||||
"key": "knobs",
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Knobs",
|
||||
"type": "list",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "name",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "value",
|
||||
"label": "Value"
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"key": "knobs",
|
||||
"type": "list",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "name",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "value",
|
||||
"label": "Value"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "splitter"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"key": "customNodes",
|
||||
"label": "Custom Nodes",
|
||||
"key": "overrideNodes",
|
||||
"label": "Plugin's node overrides",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
|
|
@ -319,27 +327,37 @@
|
|||
"label": "Nuke Node Class"
|
||||
},
|
||||
{
|
||||
"type": "splitter"
|
||||
"key": "subsets",
|
||||
"label": "Subsets",
|
||||
"type": "list",
|
||||
"object_type": "text"
|
||||
},
|
||||
{
|
||||
"key": "knobs",
|
||||
"label": "Knobs",
|
||||
"type": "list",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "name",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "value",
|
||||
"label": "Value"
|
||||
"type": "collapsible-wrap",
|
||||
"label": "Knobs overrides",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"children": [
|
||||
{
|
||||
"key": "knobs",
|
||||
"type": "list",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "name",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "value",
|
||||
"label": "Value"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -446,7 +464,7 @@
|
|||
{
|
||||
"key": "flame",
|
||||
"type": "dict",
|
||||
"label": "Flame/Flair",
|
||||
"label": "Flame & Flare",
|
||||
"children": [
|
||||
{
|
||||
"key": "project",
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@
|
|||
"object_type": "text"
|
||||
},
|
||||
{
|
||||
"key": "sebsets",
|
||||
"key": "subsets",
|
||||
"label": "Subsets",
|
||||
"type": "list",
|
||||
"object_type": "text"
|
||||
|
|
|
|||
|
|
@ -117,19 +117,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "env_group_test",
|
||||
"label": "EnvGroup Test",
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"key": "key_to_store_in_system_settings",
|
||||
"label": "Testing environment group",
|
||||
"type": "raw-json",
|
||||
"env_group_key": "test_group"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "dict_wrapper",
|
||||
"type": "dict",
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
{
|
||||
"type": "raw-json",
|
||||
"label": "{host_label} Environments",
|
||||
"key": "{host_name}_environments",
|
||||
"env_group_key": "{host_name}"
|
||||
"key": "{host_name}_environments"
|
||||
},
|
||||
{
|
||||
"type": "path",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
"key": "environment",
|
||||
"label": "Environment",
|
||||
"type": "raw-json",
|
||||
"env_group_key": "global",
|
||||
"require_restart": true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue