From 6868859aeab5bb11d08b2e5af4f2c56901971f25 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 10 May 2019 17:10:31 +0200 Subject: [PATCH] hotfix/minot fixes for submitting maya to deadline in 2.0 --- pype/ftrack/lib/ftrack_app_handler.py | 2 +- pype/plugins/global/publish/collect_scene_version.py | 6 ++++-- pype/plugins/maya/publish/collect_renderlayers.py | 7 +++++-- pype/plugins/maya/publish/submit_maya_deadline.py | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pype/ftrack/lib/ftrack_app_handler.py b/pype/ftrack/lib/ftrack_app_handler.py index 3c2bc418a8..5efb968f32 100644 --- a/pype/ftrack/lib/ftrack_app_handler.py +++ b/pype/ftrack/lib/ftrack_app_handler.py @@ -193,7 +193,7 @@ class AppAction(BaseHandler): application = avalonlib.get_application(os.environ["AVALON_APP_NAME"]) data = { - "root": os.environ.get("PYPE_STUDIO_PROJECTS_PATH"), + "root": os.environ.get("PYPE_STUDIO_PROJECTS_MOUNT"), "project": { "name": entity['project']['full_name'], "code": entity['project']['name'] diff --git a/pype/plugins/global/publish/collect_scene_version.py b/pype/plugins/global/publish/collect_scene_version.py index 06bc8e3a53..12075e2417 100644 --- a/pype/plugins/global/publish/collect_scene_version.py +++ b/pype/plugins/global/publish/collect_scene_version.py @@ -1,8 +1,8 @@ import os import pyblish.api -import os import pype.api as pype + class CollectSceneVersion(pyblish.api.ContextPlugin): """Finds version in the filename or passes the one found in the context Arguments: @@ -16,8 +16,10 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): filename = os.path.basename(context.data.get('currentFile')) - rootVersion = pype.get_version_from_path(filename) + if '' in filename: + return + rootVersion = pype.get_version_from_path(filename) context.data['version'] = rootVersion self.log.info('Scene Version: %s' % context.data('version')) diff --git a/pype/plugins/maya/publish/collect_renderlayers.py b/pype/plugins/maya/publish/collect_renderlayers.py index d2c64e2117..e494a90878 100644 --- a/pype/plugins/maya/publish/collect_renderlayers.py +++ b/pype/plugins/maya/publish/collect_renderlayers.py @@ -21,11 +21,14 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin): # Get render globals node try: render_globals = cmds.ls("renderglobalsMain")[0] + for instance in context: + self.log.debug(instance.name) + if instance.data['family'] == 'workfile': + instance.data['publish'] = True except IndexError: self.log.info("Skipping renderlayer collection, no " "renderGlobalsDefault found..") return - # Get all valid renderlayers # This is how Maya populates the renderlayer display rlm_attribute = "renderLayerManager.renderLayerId" @@ -51,7 +54,7 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin): continue if layer.endswith("defaultRenderLayer"): - layername = "masterLayer" + continue else: # Remove Maya render setup prefix `rs_` layername = layer.split("rs_", 1)[-1] diff --git a/pype/plugins/maya/publish/submit_maya_deadline.py b/pype/plugins/maya/publish/submit_maya_deadline.py index 0a97a9b98f..db3ea85034 100644 --- a/pype/plugins/maya/publish/submit_maya_deadline.py +++ b/pype/plugins/maya/publish/submit_maya_deadline.py @@ -280,7 +280,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): clean_path = clean_path.replace('python2', 'python3') clean_path = clean_path.replace( os.path.normpath(environment['PYPE_STUDIO_CORE_MOUNT']), - os.path.normpath(environment['PYPE_STUDIO_CORE'])) + os.path.normpath(environment['PYPE_STUDIO_CORE_PATH'])) clean_environment[key] = clean_path environment = clean_environment