From ea3adde2ed537b31b92b0a86bad040509980a3bd Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 23 Apr 2021 16:13:34 +0200 Subject: [PATCH 1/2] maya plugin fixes --- .../maya/plugins/publish/collect_remove_marked.py | 9 ++------- .../ftrack}/plugins/publish/collect_ftrack_family.py | 12 ++++-------- .../plugins/publish/collect_current_pype_user.py | 2 +- openpype/plugins/publish/collect_scene_version.py | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) rename openpype/{hosts/maya => modules/ftrack}/plugins/publish/collect_ftrack_family.py (64%) diff --git a/openpype/hosts/maya/plugins/publish/collect_remove_marked.py b/openpype/hosts/maya/plugins/publish/collect_remove_marked.py index a45c8e45a7..2553ccd09e 100644 --- a/openpype/hosts/maya/plugins/publish/collect_remove_marked.py +++ b/openpype/hosts/maya/plugins/publish/collect_remove_marked.py @@ -2,14 +2,9 @@ import pyblish.api class CollectRemoveMarked(pyblish.api.ContextPlugin): - """Collect model data + """Remvoe marked data - Ensures always only a single frame is extracted (current frame). - - Note: - This is a workaround so that the `pype.model` family can use the - same pointcache extractor implementation as animation and pointcaches. - This always enforces the "current" frame to be published. + Remove instances that have 'remove' in their instance.data """ diff --git a/openpype/hosts/maya/plugins/publish/collect_ftrack_family.py b/openpype/modules/ftrack/plugins/publish/collect_ftrack_family.py similarity index 64% rename from openpype/hosts/maya/plugins/publish/collect_ftrack_family.py rename to openpype/modules/ftrack/plugins/publish/collect_ftrack_family.py index b2b66b1875..e6daed9a33 100644 --- a/openpype/hosts/maya/plugins/publish/collect_ftrack_family.py +++ b/openpype/modules/ftrack/plugins/publish/collect_ftrack_family.py @@ -2,14 +2,9 @@ import pyblish.api class CollectFtrackFamilies(pyblish.api.InstancePlugin): - """Collect model data - - Ensures always only a single frame is extracted (current frame). - - Note: - This is a workaround so that the `pype.model` family can use the - same pointcache extractor implementation as animation and pointcaches. - This always enforces the "current" frame to be published. + """Collect family for ftrack publishing + + Add ftrack family to those instance that should be published to ftrack """ @@ -23,6 +18,7 @@ class CollectFtrackFamilies(pyblish.api.InstancePlugin): "rig", "camera" ] + hosts = ["maya"] def process(self, instance): diff --git a/openpype/plugins/publish/collect_current_pype_user.py b/openpype/plugins/publish/collect_current_pype_user.py index 003c779836..1a52a59012 100644 --- a/openpype/plugins/publish/collect_current_pype_user.py +++ b/openpype/plugins/publish/collect_current_pype_user.py @@ -14,4 +14,4 @@ class CollectCurrentUserPype(pyblish.api.ContextPlugin): def process(self, context): user = get_openpype_username() context.data["user"] = user - self.log.debug("Colected user \"{}\"".format(user)) + self.log.debug("Collected user \"{}\"".format(user)) diff --git a/openpype/plugins/publish/collect_scene_version.py b/openpype/plugins/publish/collect_scene_version.py index f58bd0dd9d..669e6752f3 100644 --- a/openpype/plugins/publish/collect_scene_version.py +++ b/openpype/plugins/publish/collect_scene_version.py @@ -19,7 +19,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): if "unreal" in pyblish.api.registered_hosts(): return - assert context.data.get('currentFile'), "Cannot get curren file" + assert context.data.get('currentFile'), "Cannot get current file" filename = os.path.basename(context.data.get('currentFile')) if '' in filename: From dcc6febf242dedd28c1f10abe7737893ed8ec17f Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Tue, 4 May 2021 16:40:18 +0200 Subject: [PATCH 2/2] remove duplicated plugin --- .../publish/collect_clear_instances.py | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 openpype/hosts/standalonepublisher/plugins/publish/collect_clear_instances.py diff --git a/openpype/hosts/standalonepublisher/plugins/publish/collect_clear_instances.py b/openpype/hosts/standalonepublisher/plugins/publish/collect_clear_instances.py deleted file mode 100644 index 097e730251..0000000000 --- a/openpype/hosts/standalonepublisher/plugins/publish/collect_clear_instances.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Optional: - instance.data["remove"] -> mareker for removing -""" -import pyblish.api - - -class CollectClearInstances(pyblish.api.InstancePlugin): - """Clear all marked instances""" - - order = pyblish.api.CollectorOrder + 0.4999 - label = "Clear Instances" - hosts = ["standalonepublisher"] - - def process(self, instance): - self.log.debug( - f"Instance: `{instance}` | " - f"families: `{instance.data['families']}`") - if instance.data.get("remove"): - self.log.info(f"Removing: {instance}") - instance.context.remove(instance)