mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 14:22:37 +01:00
added option to have callback before load
This commit is contained in:
parent
af895da690
commit
09c73beec9
1 changed files with 8 additions and 0 deletions
|
|
@ -1163,6 +1163,11 @@ class PlaceholderLoadMixin(object):
|
|||
context_filters=context_filters
|
||||
))
|
||||
|
||||
def _before_repre_load(self, placeholder, representation):
|
||||
"""Can be overriden. Is called before representation is loaded."""
|
||||
|
||||
pass
|
||||
|
||||
def _reduce_last_version_repre_docs(self, representations):
|
||||
"""Reduce representations to last verison."""
|
||||
|
||||
|
|
@ -1239,6 +1244,9 @@ class PlaceholderLoadMixin(object):
|
|||
for repre_load_context in repre_load_contexts.values():
|
||||
representation = repre_load_context["representation"]
|
||||
repre_context = representation["context"]
|
||||
self._before_repre_load(
|
||||
placeholder, representation
|
||||
)
|
||||
self.log.info(
|
||||
"Loading {} from {} with loader {}\n"
|
||||
"Loader arguments used : {}".format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue