mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
OP-3908 - revert back to AE specific cache method
Standard approach doesn't handle legacy instances, eg. instance without creator_identifier.
This commit is contained in:
parent
64f8e2fc9c
commit
de5decbcbb
3 changed files with 20 additions and 10 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
from Qt import QtWidgets
|
||||
import collections
|
||||
|
||||
import pyblish.api
|
||||
|
||||
|
|
@ -294,3 +295,18 @@ def containerise(name,
|
|||
stub.imprint(comp.id, data)
|
||||
|
||||
return comp
|
||||
|
||||
|
||||
def cache_and_get_instances(creator):
|
||||
"""Cache instances in shared data.
|
||||
|
||||
Storing all instances as a list as legacy instances might be still present.
|
||||
Args:
|
||||
creator (Creator): Plugin which would like to get instances from host.
|
||||
Returns:
|
||||
List[]: list of all instances stored in metadata
|
||||
"""
|
||||
shared_key = "openpype.photoshop.instances"
|
||||
if shared_key not in creator.collection_shared_data:
|
||||
creator.collection_shared_data[shared_key] = creator.list_instances()
|
||||
return creator.collection_shared_data[shared_key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue