mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
also pass new values with metadata
This commit is contained in:
parent
981443b5c3
commit
8b00525f9d
3 changed files with 26 additions and 9 deletions
|
|
@ -130,7 +130,9 @@ class FtrackModule(
|
|||
if self.tray_module:
|
||||
self.tray_module.changed_user()
|
||||
|
||||
def on_system_settings_save(self, old_value, new_value, changes):
|
||||
def on_system_settings_save(
|
||||
self, old_value, new_value, changes, new_value_metadata
|
||||
):
|
||||
"""Implementation of ISettingsChangeListener interface."""
|
||||
try:
|
||||
session = self.create_ftrack_session()
|
||||
|
|
@ -169,7 +171,7 @@ class FtrackModule(
|
|||
elif key == CUST_ATTR_TOOLS:
|
||||
tool_attribute = custom_attribute
|
||||
|
||||
app_manager = ApplicationManager(new_value)
|
||||
app_manager = ApplicationManager(new_value_metadata)
|
||||
missing_attributes = []
|
||||
if not app_attribute:
|
||||
missing_attributes.append(CUST_ATTR_APPLICATIONS)
|
||||
|
|
@ -217,7 +219,7 @@ class FtrackModule(
|
|||
return
|
||||
|
||||
def on_project_anatomy_save(
|
||||
self, old_value, new_value, changes, project_name
|
||||
self, old_value, new_value, changes, project_name, new_value_metadata
|
||||
):
|
||||
"""Implementation of ISettingsChangeListener interface."""
|
||||
if not project_name:
|
||||
|
|
|
|||
|
|
@ -16,18 +16,20 @@ class ISettingsChangeListener:
|
|||
}
|
||||
"""
|
||||
@abstractmethod
|
||||
def on_system_settings_save(self, old_value, new_value, changes):
|
||||
def on_system_settings_save(
|
||||
self, old_value, new_value, changes, new_value_metadata
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def on_project_settings_save(
|
||||
self, old_value, new_value, changes, project_name
|
||||
self, old_value, new_value, changes, project_name, new_value_metadata
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def on_project_anatomy_save(
|
||||
self, old_value, new_value, changes, project_name
|
||||
self, old_value, new_value, changes, project_name, new_value_metadata
|
||||
):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ def save_studio_settings(data):
|
|||
old_data = get_system_settings()
|
||||
default_values = get_default_settings()[SYSTEM_SETTINGS_KEY]
|
||||
new_data = apply_overrides(default_values, copy.deepcopy(data))
|
||||
new_data_with_metadata = copy.deepcopy(new_data)
|
||||
clear_metadata_from_settings(new_data)
|
||||
|
||||
changes = calculate_changes(old_data, new_data)
|
||||
|
|
@ -128,7 +129,9 @@ def save_studio_settings(data):
|
|||
for module in modules_manager.get_enabled_modules():
|
||||
if isinstance(module, ISettingsChangeListener):
|
||||
try:
|
||||
module.on_system_settings_save(old_data, new_data, changes)
|
||||
module.on_system_settings_save(
|
||||
old_data, new_data, changes, new_data_with_metadata
|
||||
)
|
||||
except SaveWarningExc as exc:
|
||||
warnings.extend(exc.warnings)
|
||||
|
||||
|
|
@ -173,6 +176,7 @@ def save_project_settings(project_name, overrides):
|
|||
old_data = get_default_project_settings(exclude_locals=True)
|
||||
new_data = apply_overrides(default_values, copy.deepcopy(overrides))
|
||||
|
||||
new_data_with_metadata = copy.deepcopy(new_data)
|
||||
clear_metadata_from_settings(new_data)
|
||||
|
||||
changes = calculate_changes(old_data, new_data)
|
||||
|
|
@ -182,7 +186,11 @@ def save_project_settings(project_name, overrides):
|
|||
if isinstance(module, ISettingsChangeListener):
|
||||
try:
|
||||
module.on_project_settings_save(
|
||||
old_data, new_data, project_name, changes
|
||||
old_data,
|
||||
new_data,
|
||||
project_name,
|
||||
changes,
|
||||
new_data_with_metadata
|
||||
)
|
||||
except SaveWarningExc as exc:
|
||||
warnings.extend(exc.warnings)
|
||||
|
|
@ -229,6 +237,7 @@ def save_project_anatomy(project_name, anatomy_data):
|
|||
old_data = get_default_anatomy_settings(exclude_locals=True)
|
||||
new_data = apply_overrides(default_values, copy.deepcopy(anatomy_data))
|
||||
|
||||
new_data_with_metadata = copy.deepcopy(new_data)
|
||||
clear_metadata_from_settings(new_data)
|
||||
|
||||
changes = calculate_changes(old_data, new_data)
|
||||
|
|
@ -238,7 +247,11 @@ def save_project_anatomy(project_name, anatomy_data):
|
|||
if isinstance(module, ISettingsChangeListener):
|
||||
try:
|
||||
module.on_project_anatomy_save(
|
||||
old_data, new_data, changes, project_name
|
||||
old_data,
|
||||
new_data,
|
||||
changes,
|
||||
project_name,
|
||||
new_data_with_metadata
|
||||
)
|
||||
except SaveWarningExc as exc:
|
||||
warnings.extend(exc.warnings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue