fixing cashing nested data structure

This commit is contained in:
Jakub Jezek 2023-05-24 16:25:34 +02:00
parent 05b0f61e0b
commit 6473fac904
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -17,9 +17,11 @@ from openpype.pipeline import Anatomy
log = Logger.get_logger(__name__)
class cashed_data:
remapping: dict = None
@contextlib.contextmanager
def _make_temp_json_file():
"""Wrapping function for json temp file
@ -510,7 +512,7 @@ def get_remapped_colorspace_to_native(
str: native colorspace name defined in remapping or None
"""
if not cashed_data.remapping.get(host_name):
if not cashed_data.remapping.get(host_name, {}).get("to_native"):
remapping_rules = imageio_host_settings["remapping"]["rules"]
cashed_data.remapping[host_name] = {
"to_native": {
@ -534,7 +536,7 @@ def get_remapped_colorspace_from_native(
str: ocio colorspace name defined in remapping or None
"""
if not cashed_data.remapping.get(host_name):
if not cashed_data.remapping.get(host_name, {}).get("from_native"):
remapping_rules = imageio_host_settings["remapping"]["rules"]
cashed_data.remapping[host_name] = {
"from_native": {