mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added wrappers for access to shared data in create plugins
This commit is contained in:
parent
e0bb8c0469
commit
2ed383c476
1 changed files with 36 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from abc import (
|
|||
abstractmethod,
|
||||
abstractproperty
|
||||
)
|
||||
|
||||
import six
|
||||
|
||||
from openpype.settings import get_system_settings, get_project_settings
|
||||
|
|
@ -323,6 +324,41 @@ class BaseCreator:
|
|||
|
||||
return self.instance_attr_defs
|
||||
|
||||
def has_collection_shared_data(self, key):
|
||||
"""Check if collection shared data are set.
|
||||
|
||||
Args:
|
||||
key (str): Key under which are shared data stored.
|
||||
|
||||
Retruns:
|
||||
bool: Key is already set.
|
||||
"""
|
||||
|
||||
return self.create_context.has_collection_shared_data(key)
|
||||
|
||||
def get_collection_shared_data(self, key, default=None):
|
||||
"""Receive shared data during collection phase.
|
||||
|
||||
Args:
|
||||
key (str): Key under which are shared data stored.
|
||||
default (Any): Default value if key is not set.
|
||||
|
||||
Returns:
|
||||
Any: Value stored under the key.
|
||||
"""
|
||||
|
||||
return self.create_context.get_collection_shared_data(key, default)
|
||||
|
||||
def set_collection_shared_data(self, key, value):
|
||||
"""Store a value under collection shared data.
|
||||
|
||||
Args:
|
||||
key (str): Key under which will shared data be stored.
|
||||
value (Any): Value to store.
|
||||
"""
|
||||
|
||||
return self.create_context.set_collection_shared_data(key, value)
|
||||
|
||||
|
||||
class Creator(BaseCreator):
|
||||
"""Creator that has more information for artist to show in UI.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue