diff --git a/pype/ftrack/events/event_sync_to_avalon.py b/pype/ftrack/events/event_sync_to_avalon.py index 31387b5934..2fcaf01f69 100644 --- a/pype/ftrack/events/event_sync_to_avalon.py +++ b/pype/ftrack/events/event_sync_to_avalon.py @@ -1731,13 +1731,20 @@ class SyncToAvalonEvent(BaseEvent): attributes_joined = ", ".join([ "\"{}\"".format(name) for name in hier_cust_attrs_keys ]) - [values] = self.process_session._call([{ + + queries = [{ "action": "query", "expression": ( "select value, entity_id from CustomAttributeValue " "where entity_id in ({}) and configuration.key in ({})" ).format(entity_ids_joined, attributes_joined) - }]) + }] + if not missing_defaults: + if hasattr(session, "call"): + [values] = session.call(queries) + else: + [values] = session._call(queries) + ftrack_project_id = self.cur_project["id"] for attr in hier_attrs: diff --git a/pype/ftrack/lib/avalon_sync.py b/pype/ftrack/lib/avalon_sync.py index 88013a55b4..61a916a70e 100644 --- a/pype/ftrack/lib/avalon_sync.py +++ b/pype/ftrack/lib/avalon_sync.py @@ -780,10 +780,10 @@ class SyncEntitiesFactory: entity_ids_joined, attributes_joined ) }] - if hasattr(self.session, "_call"): - [values] = self.session._call(call_expr) - else: + if hasattr(self.session, "call"): [values] = self.session.call(call_expr) + else: + [values] = self.session._call(call_expr) for value in values["data"]: entity_id = value["entity_id"] @@ -843,10 +843,10 @@ class SyncEntitiesFactory: "where entity_id in ({}) and configuration.key in ({})" ).format(entity_ids_joined, attributes_joined) }] - if hasattr(self.session, "_call"): - [values] = self.session._call(call_expr) - else: + if hasattr(self.session, "call"): [values] = self.session.call(call_expr) + else: + [values] = self.session._call(call_expr) avalon_hier = [] for value in values["data"]: