diff --git a/openpype/hosts/testhost/plugins/create/auto_creator.py b/openpype/hosts/testhost/plugins/create/auto_creator.py index bf586f894a..f1e9098af3 100644 --- a/openpype/hosts/testhost/plugins/create/auto_creator.py +++ b/openpype/hosts/testhost/plugins/create/auto_creator.py @@ -17,7 +17,7 @@ class MyAutoCreator(AutoCreator): ] return output - def collect_instances(self, attr_plugins=None): + def collect_instances(self): for instance_data in pipeline.list_instances(): creator_id = instance_data.get("creator_identifier") if creator_id is not None: @@ -31,7 +31,7 @@ class MyAutoCreator(AutoCreator): elif instance_data["family"] == self.identifier: instance_data["creator_identifier"] = self.identifier instance = CreatedInstance.from_existing( - instance_data, self, attr_plugins + instance_data, self ) self._add_instance_to_context(instance) diff --git a/openpype/hosts/testhost/plugins/create/test_creator_1.py b/openpype/hosts/testhost/plugins/create/test_creator_1.py index a7555ac89c..6a513d070f 100644 --- a/openpype/hosts/testhost/plugins/create/test_creator_1.py +++ b/openpype/hosts/testhost/plugins/create/test_creator_1.py @@ -15,20 +15,20 @@ class TestCreatorOne(Creator): def get_icon(self): return resources.get_openpype_splash_filepath() - def collect_instances(self, attr_plugins): + def collect_instances(self): for instance_data in pipeline.list_instances(): instance = None creator_id = instance_data.get("creator_identifier") if creator_id is not None: if creator_id == self.identifier: instance = CreatedInstance.from_existing( - instance_data, self, attr_plugins + instance_data, self ) elif instance_data["family"] == self.identifier: instance_data["creator_identifier"] = self.identifier instance = CreatedInstance.from_existing( - instance_data, self, attr_plugins + instance_data, self ) if instance is not None: diff --git a/openpype/hosts/testhost/plugins/create/test_creator_2.py b/openpype/hosts/testhost/plugins/create/test_creator_2.py index 4017d74a08..9168fea0d2 100644 --- a/openpype/hosts/testhost/plugins/create/test_creator_2.py +++ b/openpype/hosts/testhost/plugins/create/test_creator_2.py @@ -20,20 +20,20 @@ class TestCreatorTwo(Creator): self.log.info(new_instance.data) self._add_instance_to_context(new_instance) - def collect_instances(self, attr_plugins): + def collect_instances(self): for instance_data in pipeline.list_instances(): instance = None creator_id = instance_data.get("creator_identifier") if creator_id is not None: if creator_id == self.identifier: instance = CreatedInstance.from_existing( - instance_data, self, attr_plugins + instance_data, self ) elif instance_data["family"] == self.identifier: instance_data["creator_identifier"] = self.identifier instance = CreatedInstance.from_existing( - instance_data, self, attr_plugins + instance_data, self ) if instance is not None: diff --git a/openpype/pipeline/create/context.py b/openpype/pipeline/create/context.py index f870fe6a65..048f4c6418 100644 --- a/openpype/pipeline/create/context.py +++ b/openpype/pipeline/create/context.py @@ -344,7 +344,6 @@ class CreatedInstance: creator(BaseCreator): Creator responsible for instance. host(ModuleType): Host implementation loaded with `avalon.api.registered_host`. - attr_plugins(list): List of attribute definitions of publish plugins. new(bool): Is instance new. """ # Keys that can't be changed or removed from data after loading using @@ -361,8 +360,7 @@ class CreatedInstance: ) def __init__( - self, family, subset_name, data, creator, host=None, - attr_plugins=None, new=True + self, family, subset_name, data, creator, host=None, new=True ): if host is None: import avalon.api @@ -416,8 +414,9 @@ class CreatedInstance: # Stored publish specific attribute values # {: {key: value}} + # - must be set using 'set_publish_plugins' self._data["publish_attributes"] = PublishAttributes( - self, orig_publish_attributes, attr_plugins + self, orig_publish_attributes, None ) if data: self._data.update(data) @@ -584,7 +583,7 @@ class CreatedInstance: @classmethod def from_existing( - cls, instance_data, creator, attr_plugins=None, host=None + cls, instance_data, creator, host=None ): """Convert instance data from workfile to CreatedInstance.""" instance_data = copy.deepcopy(instance_data) @@ -595,8 +594,7 @@ class CreatedInstance: subset_name = instance_data.get("subset", None) return cls( - family, subset_name, instance_data, creator, host, - attr_plugins, new=False + family, subset_name, instance_data, creator, host, new=False ) def set_publish_plugins(self, attr_plugins): @@ -821,10 +819,7 @@ class CreateContext: # Collect instances for creator in self.creators.values(): - attr_plugins = self._get_publish_plugins_with_attr_for_family( - creator.family - ) - creator.collect_instances(attr_plugins) + creator.collect_instances() def execute_autocreators(self): """Execute discovered AutoCreator plugins.