mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
create context has callbacks for reset preparation and finalization
This commit is contained in:
parent
ec206bec00
commit
bacbff0262
2 changed files with 19 additions and 0 deletions
|
|
@ -860,6 +860,9 @@ class CreateContext:
|
|||
|
||||
All changes will be lost if were not saved explicitely.
|
||||
"""
|
||||
|
||||
self.reset_preparation()
|
||||
|
||||
self.reset_avalon_context()
|
||||
self.reset_plugins(discover_publish_plugins)
|
||||
self.reset_context_data()
|
||||
|
|
@ -868,6 +871,18 @@ class CreateContext:
|
|||
self.reset_instances()
|
||||
self.execute_autocreators()
|
||||
|
||||
self.reset_finalization()
|
||||
|
||||
def reset_preparation(self):
|
||||
"""Prepare attributes that must be prepared/cleaned before reset."""
|
||||
|
||||
pass
|
||||
|
||||
def reset_finalization(self):
|
||||
"""Cleanup of attributes after reset."""
|
||||
|
||||
pass
|
||||
|
||||
def reset_avalon_context(self):
|
||||
"""Give ability to reset avalon context.
|
||||
|
||||
|
|
|
|||
|
|
@ -552,6 +552,8 @@ class PublisherController:
|
|||
|
||||
self.save_changes()
|
||||
|
||||
self.create_context.reset_preparation()
|
||||
|
||||
# Reset avalon context
|
||||
self.create_context.reset_avalon_context()
|
||||
|
||||
|
|
@ -560,6 +562,8 @@ class PublisherController:
|
|||
self._reset_publish()
|
||||
self._reset_instances()
|
||||
|
||||
self.create_context.reset_finalization()
|
||||
|
||||
self.emit_card_message("Refreshed..")
|
||||
|
||||
def _reset_plugins(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue