mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
added method to update context
This commit is contained in:
parent
7537cf8ebc
commit
b35055c3c7
3 changed files with 18 additions and 0 deletions
|
|
@ -347,6 +347,12 @@ class AbstractPublisherFrontend(AbstractPublisherCommon):
|
|||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def set_instances_context_info(
|
||||
self, changes_by_instance_id: Dict[str, Dict[str, Any]]
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_existing_product_names(self, folder_path: str) -> List[str]:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -195,6 +195,11 @@ class PublisherController(
|
|||
def get_instances_context_info(self, instance_ids=None):
|
||||
return self._create_model.get_instances_context_info(instance_ids)
|
||||
|
||||
def set_instances_context_info(self, changes_by_instance_id):
|
||||
return self._create_model.set_instances_context_info(
|
||||
changes_by_instance_id
|
||||
)
|
||||
|
||||
def get_convertor_items(self):
|
||||
return self._create_model.get_convertor_items()
|
||||
|
||||
|
|
|
|||
|
|
@ -447,6 +447,13 @@ class CreateModel:
|
|||
instances
|
||||
)
|
||||
|
||||
def set_instances_context_info(self, changes_by_instance_id):
|
||||
with self._create_context.bulk_value_changes(CREATE_EVENT_SOURCE):
|
||||
for instance_id, changes in changes_by_instance_id.items():
|
||||
instance = self._get_instance_by_id(instance_id)
|
||||
for key, value in changes.items():
|
||||
instance[key] = value
|
||||
|
||||
def get_convertor_items(self) -> Dict[str, ConvertorItem]:
|
||||
return self._create_context.convertor_items_by_id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue