From 7f69d96eb771b631c4dfe0d5e6932279776aa215 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 8 Jul 2021 16:12:19 +0200 Subject: [PATCH] controller have method to return attributes for passed instances --- openpype/tools/new_publisher/control.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openpype/tools/new_publisher/control.py b/openpype/tools/new_publisher/control.py index 2a74b218b5..3a2edd5c9d 100644 --- a/openpype/tools/new_publisher/control.py +++ b/openpype/tools/new_publisher/control.py @@ -105,6 +105,24 @@ class PublisherController: self.instances = instances + def get_family_attribute_definitions(self, instances): + attr_defs = [] + if len(instances) == 1: + instance = instances[0] + family = instance.data["family"] + creator = self.creators.get(family) + if not creator: + # TODO handle when creator is not available + return + + attr_defs = creator.get_attribute_defs() + + else: + # TODO mulsiselection + pass + + return attr_defs + def create(self, family, subset_name, instance_data, options): # QUESTION Force to return instances or call `list_instances` on each # creation? (`list_instances` may slow down...)