From 1b27cc59f8e03994b38d7d4bd8127e366c26d547 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 29 Oct 2019 11:05:31 +0100 Subject: [PATCH] get_parents get parents from entity instead of getting through all parents if possible --- pype/standalonepublish/widgets/widget_asset.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/standalonepublish/widgets/widget_asset.py b/pype/standalonepublish/widgets/widget_asset.py index 0bd7e67051..d9241bd91f 100644 --- a/pype/standalonepublish/widgets/widget_asset.py +++ b/pype/standalonepublish/widgets/widget_asset.py @@ -219,6 +219,10 @@ class AssetWidget(QtWidgets.QWidget): return data def get_parents(self, entity): + ent_parents = entity.get("data", {}).get("parents") + if ent_parents is not None and isinstance(ent_parents, list): + return ent_parents + output = [] if entity.get('data', {}).get('visualParent', None) is None: return output