From 9c9c134a794a5ab9bd36a415ef15d2b2b64dbdd8 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 7 Mar 2023 17:39:05 +0100 Subject: [PATCH] Use passthrough state of saver tool to store and load the active state --- openpype/hosts/fusion/plugins/create/create_saver.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openpype/hosts/fusion/plugins/create/create_saver.py b/openpype/hosts/fusion/plugins/create/create_saver.py index bf11dc95c5..e581bac20f 100644 --- a/openpype/hosts/fusion/plugins/create/create_saver.py +++ b/openpype/hosts/fusion/plugins/create/create_saver.py @@ -109,6 +109,12 @@ class CreateSaver(Creator): def _imprint(self, tool, data): # Save all data in a "openpype.{key}" = value data + + active = data.pop("active", None) + if active is not None: + # Use active value to set the passthrough state + tool.SetAttrs({"TOOLB_PassThrough": not active}) + for key, value in data.items(): tool.SetData(f"openpype.{key}", value) @@ -192,6 +198,11 @@ class CreateSaver(Creator): if key not in data or data[key] != value: return + # Get active state from the actual tool state + attrs = tool.GetAttrs() + passthrough = attrs["TOOLB_PassThrough"] + data["active"] = not passthrough + return data def get_instance_attr_defs(self):