From b823f3d80e0c898c53ca8aeda2536f8f114f3243 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Mon, 26 Sep 2022 08:22:41 +0300 Subject: [PATCH 01/32] 8c4e93cfc Merge branch 'develop' into enhancement/OP-3783_Maya-Playblast-Options --- .../defaults/project_settings/maya.json | 5 ++++ .../schemas/schema_maya_capture.json | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 76ef0a7338..daaa8da8e6 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -712,6 +712,11 @@ "motionBlurEnable": false, "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.2, + "xray": false, + "udm": false, + "wos": false, + "jointXray": false, + "backfaceCulling": false, "cameras": false, "clipGhosts": false, "deformers": false, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 62c33f55fc..02c25e8a03 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -348,6 +348,31 @@ "type": "label", "label": "Show" }, + { + "type": "boolean", + "key": "xray", + "label": "Toggle X-Ray Mode" + }, + { + "type": "boolean", + "key": "udm", + "label": "Use Default Material" + }, + { + "type": "boolean", + "key": "wos", + "label": "Wireframe On Shaded" + }, + { + "type": "boolean", + "key": "jointXray", + "label": "Toggle Joint X-Ray Mode" + }, + { + "type": "boolean", + "key": "backfaceCulling", + "label": "Enable Back Face Culling" + }, { "type": "boolean", "key": "cameras", From 486589ef3479af1907f813b08a20c319e5f60141 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Mon, 26 Sep 2022 08:24:50 +0300 Subject: [PATCH 02/32] 8c4e93cfc Merge branch 'develop' into enhancement/OP-3783_Maya-Playblast-Options --- openpype/settings/defaults/project_anatomy/attributes.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_anatomy/attributes.json b/openpype/settings/defaults/project_anatomy/attributes.json index 983ac603f9..bf8bbef8de 100644 --- a/openpype/settings/defaults/project_anatomy/attributes.json +++ b/openpype/settings/defaults/project_anatomy/attributes.json @@ -19,8 +19,7 @@ "blender/2-91", "harmony/20", "photoshop/2021", - "aftereffects/2021", - "unreal/4-26" + "aftereffects/2021" ], "tools_env": [], "active": true From 45732d884b89b9336bf8bb4e0387ac91cc916539 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Mon, 26 Sep 2022 08:25:45 +0300 Subject: [PATCH 03/32] 8c4e93cfc Merge branch 'develop' into enhancement/OP-3783_Maya-Playblast-Options --- .../schemas/schema_maya_capture.json | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 02c25e8a03..c3d051b56e 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -352,6 +352,34 @@ "type": "boolean", "key": "xray", "label": "Toggle X-Ray Mode" +<<<<<<< Updated upstream +======= + }, + { + "type": "boolean", + "key": "udm", + "label": "Use Default Material" + }, + { + "type": "boolean", + "key": "wos", + "label": "Wireframe On Shaded" + }, + { + "type": "boolean", + "key": "jointXray", + "label": "Toggle Joint X-Ray Mode" + }, + { + "type": "boolean", + "key": "backfaceCulling", + "label": "Enable Back Face Culling" + }, + { + "type": "boolean", + "key": "cameras", + "label": "cameras" +>>>>>>> Stashed changes }, { "type": "boolean", From 94cb7bee1f4b8c54e26b0364c3f272734305bba0 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:11:11 +0300 Subject: [PATCH 04/32] Move schema to a higher location. Co-authored-by: Roy Nieterau --- .../schemas/schema_maya_capture.json | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 02c25e8a03..88c994ca8f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -349,10 +349,9 @@ "label": "Show" }, { - "type": "boolean", - "key": "xray", - "label": "Toggle X-Ray Mode" - }, + "type": "label", + "label": "Shading" + }, { "type": "boolean", "key": "udm", @@ -363,15 +362,20 @@ "key": "wos", "label": "Wireframe On Shaded" }, + { + "type": "boolean", + "key": "xray", + "label": "X-Ray" + }, { "type": "boolean", "key": "jointXray", - "label": "Toggle Joint X-Ray Mode" + "label": "X-Ray Joints" }, { "type": "boolean", "key": "backfaceCulling", - "label": "Enable Back Face Culling" + "label": "Backface Culling" }, { "type": "boolean", From cfddc9f9fe2d96b88b91c9a368af2a79c0a00550 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:25:06 +0300 Subject: [PATCH 05/32] Update openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json Co-authored-by: Roy Nieterau --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 88c994ca8f..1b9ef2c30b 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -354,12 +354,12 @@ }, { "type": "boolean", - "key": "udm", + "key": "useDefaultMaterial", "label": "Use Default Material" }, { "type": "boolean", - "key": "wos", + "key": "wireframeOnShaded", "label": "Wireframe On Shaded" }, { From 6e7309ea2dd077843e54456cd9b263651d73aa65 Mon Sep 17 00:00:00 2001 From: "Allan I. A" <76656700+Allan-I@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:25:23 +0300 Subject: [PATCH 06/32] Update openpype/settings/defaults/project_settings/maya.json Co-authored-by: Roy Nieterau --- openpype/settings/defaults/project_settings/maya.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index daaa8da8e6..b873827df0 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -713,8 +713,8 @@ "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.2, "xray": false, - "udm": false, - "wos": false, + "useDefaultMaterial": false, + "wireframeOnShaded": false, "jointXray": false, "backfaceCulling": false, "cameras": false, From aeef0a484e257e868c9f5ec334e98bf4ad013f39 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 28 Sep 2022 15:06:20 +0300 Subject: [PATCH 07/32] Fix bug --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index 0a28cc2552..aba6a020f8 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -348,8 +348,6 @@ "type": "label", "label": "Show" }, - { - "type": "label", { "type": "boolean", "key": "useDefaultMaterial", @@ -379,7 +377,6 @@ "type": "boolean", "key": "cameras", "label": "cameras" ->>>>>>> Stashed changes }, { "type": "boolean", From 3d7af9e434e283b0606814b75589ef4643e150cd Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Wed, 28 Sep 2022 15:27:01 +0300 Subject: [PATCH 08/32] Remove redundant, move playblast options. --- .../schemas/schema_maya_capture.json | 75 +++++++------------ 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index aba6a020f8..ff3c5a79f4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -221,6 +221,31 @@ { "type": "splitter" }, + { + "type": "boolean", + "key": "useDefaultMaterial", + "label": "Use Default Material" + }, + { + "type": "boolean", + "key": "wireframeOnShaded", + "label": "Wireframe On Shaded" + }, + { + "type": "boolean", + "key": "xray", + "label": "X-Ray" + }, + { + "type": "boolean", + "key": "jointXray", + "label": "X-Ray Joints" + }, + { + "type": "boolean", + "key": "backfaceCulling", + "label": "Backface Culling" + }, { "type": "boolean", "key": "ssaoEnable", @@ -348,56 +373,6 @@ "type": "label", "label": "Show" }, - { - "type": "boolean", - "key": "useDefaultMaterial", - "label": "Use Default Material" - }, - { - "type": "boolean", - "key": "wireframeOnShaded", - "label": "Wireframe On Shaded" - }, - { - "type": "boolean", - "key": "xray", - "label": "X-Ray" - }, - { - "type": "boolean", - "key": "jointXray", - "label": "X-Ray Joints" - }, - { - "type": "boolean", - "key": "backfaceCulling", - "label": "Backface Culling" - }, - { - "type": "boolean", - "key": "cameras", - "label": "cameras" - }, - { - "type": "boolean", - "key": "udm", - "label": "Use Default Material" - }, - { - "type": "boolean", - "key": "wos", - "label": "Wireframe On Shaded" - }, - { - "type": "boolean", - "key": "jointXray", - "label": "Toggle Joint X-Ray Mode" - }, - { - "type": "boolean", - "key": "backfaceCulling", - "label": "Enable Back Face Culling" - }, { "type": "boolean", "key": "cameras", From 4d15535163119fbe2989ff068740477418eb28cf Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Mon, 3 Oct 2022 13:43:26 +0300 Subject: [PATCH 09/32] remove unnecessary line --- openpype/settings/defaults/project_anatomy/attributes.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/settings/defaults/project_anatomy/attributes.json b/openpype/settings/defaults/project_anatomy/attributes.json index bf8bbef8de..c2d2aa9b15 100644 --- a/openpype/settings/defaults/project_anatomy/attributes.json +++ b/openpype/settings/defaults/project_anatomy/attributes.json @@ -18,9 +18,8 @@ "houdini/18-5", "blender/2-91", "harmony/20", - "photoshop/2021", - "aftereffects/2021" + "photoshop/2021" ], "tools_env": [], "active": true -} \ No newline at end of file +} From f6f3abf33811d875cce9a9f11829996d38645a61 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 4 Oct 2022 10:58:26 +0300 Subject: [PATCH 10/32] Add label below splitter. --- .../schemas/projects_schema/schemas/schema_maya_capture.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json index ff3c5a79f4..1f0e4eeffb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_capture.json @@ -184,6 +184,10 @@ { "type": "splitter" }, + { + "type": "label", + "label": "Display" + }, { "type":"boolean", "key": "renderDepthOfField", From 3c7fa6faa5af05e96fc3a42c3ca5d5175b910301 Mon Sep 17 00:00:00 2001 From: Allan Ihsan Date: Tue, 4 Oct 2022 10:58:37 +0300 Subject: [PATCH 11/32] Reorder defaults --- openpype/settings/defaults/project_settings/maya.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index b873827df0..e2a3357cfe 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -695,6 +695,11 @@ "twoSidedLighting": true, "lineAAEnable": true, "multiSample": 8, + "useDefaultMaterial": false, + "wireframeOnShaded": false, + "xray": false, + "jointXray": false, + "backfaceCulling": false, "ssaoEnable": false, "ssaoAmount": 1, "ssaoRadius": 16, @@ -712,11 +717,6 @@ "motionBlurEnable": false, "motionBlurSampleCount": 8, "motionBlurShutterOpenFraction": 0.2, - "xray": false, - "useDefaultMaterial": false, - "wireframeOnShaded": false, - "jointXray": false, - "backfaceCulling": false, "cameras": false, "clipGhosts": false, "deformers": false, From ce0a6d8ba4ba2ceae2c32cf61e4f8ec52c5f9700 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 10 Jan 2023 09:21:09 +0000 Subject: [PATCH 12/32] Fix --- openpype/hosts/maya/api/lib_renderproducts.py | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/maya/api/lib_renderproducts.py b/openpype/hosts/maya/api/lib_renderproducts.py index c54e3ab3e0..fcc844d5d6 100644 --- a/openpype/hosts/maya/api/lib_renderproducts.py +++ b/openpype/hosts/maya/api/lib_renderproducts.py @@ -797,6 +797,11 @@ class RenderProductsVray(ARenderProducts): if default_ext in {"exr (multichannel)", "exr (deep)"}: default_ext = "exr" + # Define multipart. + multipart = False + if image_format_str == "exr (multichannel)": + multipart = True + products = [] # add beauty as default when not disabled @@ -804,23 +809,28 @@ class RenderProductsVray(ARenderProducts): if not dont_save_rgb: for camera in cameras: products.append( - RenderProduct(productName="", - ext=default_ext, - camera=camera)) + RenderProduct( + productName="", + ext=default_ext, + camera=camera, + multipart=multipart + ) + ) # separate alpha file separate_alpha = self._get_attr("vraySettings.separateAlpha") if separate_alpha: for camera in cameras: products.append( - RenderProduct(productName="Alpha", - ext=default_ext, - camera=camera) + RenderProduct( + productName="Alpha", + ext=default_ext, + camera=camera, + multipart=multipart + ) ) - - if image_format_str == "exr (multichannel)": + if multipart: # AOVs are merged in m-channel file, only main layer is rendered - self.multipart = True return products # handle aovs from references From 5bb1405a5506ceec98f885237da9a372c210e91a Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 10 Jan 2023 09:21:17 +0000 Subject: [PATCH 13/32] Code cosmetics --- openpype/hosts/maya/plugins/publish/collect_render.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_render.py b/openpype/hosts/maya/plugins/publish/collect_render.py index b1ad3ca58e..23fcd730d5 100644 --- a/openpype/hosts/maya/plugins/publish/collect_render.py +++ b/openpype/hosts/maya/plugins/publish/collect_render.py @@ -42,7 +42,6 @@ Provides: import re import os import platform -import json from maya import cmds import maya.app.renderSetup.model.renderSetup as renderSetup From 6f404ed450f2141a2f1efba13c87918ee74948c1 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 10 Jan 2023 09:21:38 +0000 Subject: [PATCH 14/32] Improve debug logging. --- .../deadline/plugins/publish/submit_publish_job.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 5c5c54febb..4d98cabe25 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -503,6 +503,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # toggle preview on if multipart is on if instance_data.get("multipartExr"): + self.log.debug("Adding preview tag because its multipartExr") preview = True self.log.debug("preview:{}".format(preview)) new_instance = deepcopy(instance_data) @@ -582,6 +583,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): if instance["useSequenceForReview"]: # toggle preview on if multipart is on if instance.get("multipartExr", False): + self.log.debug("Adding preview tag because its multipartExr") preview = True else: render_file_name = list(collection)[0] @@ -689,8 +691,14 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): if preview: if "ftrack" not in families: if os.environ.get("FTRACK_SERVER"): + self.log.debug( + "Adding \"ftrack\" to families because of preview tag." + ) families.append("ftrack") if "review" not in families: + self.log.debug( + "Adding \"review\" to families because of preview tag." + ) families.append("review") instance["families"] = families From a09667670a3c84afb87f95427500a9e1dc4461b5 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 10 Jan 2023 09:29:23 +0000 Subject: [PATCH 15/32] Hound --- .../modules/deadline/plugins/publish/submit_publish_job.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 4d98cabe25..45463ead1b 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -583,7 +583,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): if instance["useSequenceForReview"]: # toggle preview on if multipart is on if instance.get("multipartExr", False): - self.log.debug("Adding preview tag because its multipartExr") + self.log.debug( + "Adding preview tag because its multipartExr" + ) preview = True else: render_file_name = list(collection)[0] From 280d977868d89edb3ecd15801f9bc7cf2c706d18 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 Feb 2023 18:39:41 +0000 Subject: [PATCH 16/32] Only parse focussed panel if its a modelPanel. --- openpype/hosts/maya/plugins/publish/extract_playblast.py | 4 ++-- openpype/hosts/maya/plugins/publish/extract_thumbnail.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_playblast.py b/openpype/hosts/maya/plugins/publish/extract_playblast.py index 1f9f9db99a..e4e44e4770 100644 --- a/openpype/hosts/maya/plugins/publish/extract_playblast.py +++ b/openpype/hosts/maya/plugins/publish/extract_playblast.py @@ -131,8 +131,8 @@ class ExtractPlayblast(publish.Extractor): # Update preset with current panel setting # if override_viewport_options is turned off - if not override_viewport_options: - panel = cmds.getPanel(withFocus=True) + panel = cmds.getPanel(withFocus=True) or "" + if not override_viewport_options and "modelPanel" in panel: panel_preset = capture.parse_active_view() preset.update(panel_preset) cmds.setFocus(panel) diff --git a/openpype/hosts/maya/plugins/publish/extract_thumbnail.py b/openpype/hosts/maya/plugins/publish/extract_thumbnail.py index 1edafeb926..1d94bd58c5 100644 --- a/openpype/hosts/maya/plugins/publish/extract_thumbnail.py +++ b/openpype/hosts/maya/plugins/publish/extract_thumbnail.py @@ -134,8 +134,8 @@ class ExtractThumbnail(publish.Extractor): # Update preset with current panel setting # if override_viewport_options is turned off - if not override_viewport_options: - panel = cmds.getPanel(withFocus=True) + panel = cmds.getPanel(withFocus=True) or "" + if not override_viewport_options and "modelPanel" in panel: panel_preset = capture.parse_active_view() preset.update(panel_preset) cmds.setFocus(panel) From 684c759f516d987e3e59a84584bd295869d02fcc Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 9 Feb 2023 18:32:52 +0000 Subject: [PATCH 17/32] Fix capturing from wrong camera. --- .../maya/plugins/publish/extract_playblast.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_playblast.py b/openpype/hosts/maya/plugins/publish/extract_playblast.py index e4e44e4770..0140850dc9 100644 --- a/openpype/hosts/maya/plugins/publish/extract_playblast.py +++ b/openpype/hosts/maya/plugins/publish/extract_playblast.py @@ -1,4 +1,5 @@ import os +import json import clique import capture @@ -44,10 +45,6 @@ class ExtractPlayblast(publish.Extractor): # get cameras camera = instance.data['review_camera'] - override_viewport_options = ( - self.capture_preset['Viewport Options'] - ['override_viewport_options'] - ) preset = lib.load_capture_preset(data=self.capture_preset) # Grab capture presets from the project settings capture_presets = self.capture_preset @@ -119,6 +116,9 @@ class ExtractPlayblast(publish.Extractor): pan_zoom = cmds.getAttr("{}.panZoomEnabled".format(preset["camera"])) cmds.setAttr("{}.panZoomEnabled".format(preset["camera"]), False) + override_viewport_options = ( + capture_presets['Viewport Options']['override_viewport_options'] + ) with lib.maintained_time(): filename = preset.get("filename", "%TEMP%") @@ -127,16 +127,21 @@ class ExtractPlayblast(publish.Extractor): # playblast and viewer preset['viewer'] = False - self.log.info('using viewport preset: {}'.format(preset)) - # Update preset with current panel setting # if override_viewport_options is turned off panel = cmds.getPanel(withFocus=True) or "" if not override_viewport_options and "modelPanel" in panel: panel_preset = capture.parse_active_view() + panel_preset.pop("camera") preset.update(panel_preset) cmds.setFocus(panel) + self.log.info( + "Using preset:\n{}".format( + json.dumps(preset, sort_keys=True, indent=4) + ) + ) + path = capture.capture(log=self.log, **preset) cmds.setAttr("{}.panZoomEnabled".format(preset["camera"]), pan_zoom) From 25e4a4b5a3b23fde16f5908b07d81103be99fd03 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 Feb 2023 16:15:55 +0100 Subject: [PATCH 18/32] Added support for multiple install dirs in Deadline SearchDirectoryList returns FIRST existing so if you would have multiple OP install dirs, it won't search for appropriate version in later ones. --- .../custom/plugins/GlobalJobPreLoad.py | 28 ++++++++++--------- .../custom/plugins/OpenPype/OpenPype.py | 23 +++++++-------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/openpype/modules/deadline/repository/custom/plugins/GlobalJobPreLoad.py b/openpype/modules/deadline/repository/custom/plugins/GlobalJobPreLoad.py index 984590ddba..65a3782dfe 100644 --- a/openpype/modules/deadline/repository/custom/plugins/GlobalJobPreLoad.py +++ b/openpype/modules/deadline/repository/custom/plugins/GlobalJobPreLoad.py @@ -196,19 +196,21 @@ def get_openpype_versions(dir_list): print(">>> Getting OpenPype executable ...") openpype_versions = [] - install_dir = DirectoryUtils.SearchDirectoryList(dir_list) - if install_dir: - print("--- Looking for OpenPype at: {}".format(install_dir)) - sub_dirs = [ - f.path for f in os.scandir(install_dir) - if f.is_dir() - ] - for subdir in sub_dirs: - version = get_openpype_version_from_path(subdir) - if not version: - continue - print(" - found: {} - {}".format(version, subdir)) - openpype_versions.append((version, subdir)) + # special case of multiple install dirs + for dir_list in dir_list.split(","): + install_dir = DirectoryUtils.SearchDirectoryList(dir_list) + if install_dir: + print("--- Looking for OpenPype at: {}".format(install_dir)) + sub_dirs = [ + f.path for f in os.scandir(install_dir) + if f.is_dir() + ] + for subdir in sub_dirs: + version = get_openpype_version_from_path(subdir) + if not version: + continue + print(" - found: {} - {}".format(version, subdir)) + openpype_versions.append((version, subdir)) return openpype_versions diff --git a/openpype/modules/deadline/repository/custom/plugins/OpenPype/OpenPype.py b/openpype/modules/deadline/repository/custom/plugins/OpenPype/OpenPype.py index 6b0f69d98f..ae31f2e35f 100644 --- a/openpype/modules/deadline/repository/custom/plugins/OpenPype/OpenPype.py +++ b/openpype/modules/deadline/repository/custom/plugins/OpenPype/OpenPype.py @@ -107,17 +107,18 @@ class OpenPypeDeadlinePlugin(DeadlinePlugin): "Scanning for compatible requested " f"version {requested_version}")) dir_list = self.GetConfigEntry("OpenPypeInstallationDirs") - install_dir = DirectoryUtils.SearchDirectoryList(dir_list) - if dir: - sub_dirs = [ - f.path for f in os.scandir(install_dir) - if f.is_dir() - ] - for subdir in sub_dirs: - version = self.get_openpype_version_from_path(subdir) - if not version: - continue - openpype_versions.append((version, subdir)) + for dir_list in dir_list.split(","): + install_dir = DirectoryUtils.SearchDirectoryList(dir_list) + if install_dir: + sub_dirs = [ + f.path for f in os.scandir(install_dir) + if f.is_dir() + ] + for subdir in sub_dirs: + version = self.get_openpype_version_from_path(subdir) + if not version: + continue + openpype_versions.append((version, subdir)) exe_list = self.GetConfigEntry("OpenPypeExecutable") exe = FileUtils.SearchFileList(exe_list) From 6225083ffe36e197187506e5fd8a59a895e57fb2 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 14 Feb 2023 07:06:56 +0000 Subject: [PATCH 19/32] Default Ftrack Family on RenderLayer With default settings, renderlayers in Maya were not being tagged with the Ftrack family leading to confusion when doing reviews. --- openpype/settings/defaults/project_settings/ftrack.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index cdf861df4a..ed646e29fa 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -324,7 +324,8 @@ "animation", "look", "rig", - "camera" + "camera", + "renderlayer" ], "task_types": [], "tasks": [], @@ -494,4 +495,4 @@ "farm_status_profiles": [] } } -} \ No newline at end of file +} From 83c75b8b41be6fc865056b105a75cb9fe5f4dcaa Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 14 Feb 2023 09:08:09 +0000 Subject: [PATCH 20/32] Revert "Default Ftrack Family on RenderLayer" This reverts commit 6225083ffe36e197187506e5fd8a59a895e57fb2. --- openpype/settings/defaults/project_settings/ftrack.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index ed646e29fa..cdf861df4a 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -324,8 +324,7 @@ "animation", "look", "rig", - "camera", - "renderlayer" + "camera" ], "task_types": [], "tasks": [], @@ -495,4 +494,4 @@ "farm_status_profiles": [] } } -} +} \ No newline at end of file From bcf020e4fa2d9bd1c653a96a084691a451c37b4f Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 14 Feb 2023 09:19:17 +0000 Subject: [PATCH 21/32] Modify defaults through UI --- openpype/settings/defaults/project_settings/ftrack.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index cdf861df4a..bd761ccd92 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -324,7 +324,8 @@ "animation", "look", "rig", - "camera" + "camera", + "renderlayer" ], "task_types": [], "tasks": [], From e6bf6add2f0b25d93dfd0d822b3d1d5a4393f1a2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 17 Feb 2023 10:48:15 +0100 Subject: [PATCH 22/32] modify integrate ftrack instances to be able upload origin filename --- .../ftrack/plugins/publish/integrate_ftrack_instances.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_instances.py b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_instances.py index d6cb3daf0d..75f43cb22f 100644 --- a/openpype/modules/ftrack/plugins/publish/integrate_ftrack_instances.py +++ b/openpype/modules/ftrack/plugins/publish/integrate_ftrack_instances.py @@ -56,6 +56,7 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin): "reference": "reference" } keep_first_subset_name_for_review = True + upload_reviewable_with_origin_name = False asset_versions_status_profiles = [] additional_metadata_keys = [] @@ -294,6 +295,13 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin): ) # Add item to component list component_list.append(review_item) + if self.upload_reviewable_with_origin_name: + origin_name_component = copy.deepcopy(review_item) + filename = os.path.basename(repre_path) + origin_name_component["component_data"]["name"] = ( + os.path.splitext(filename)[0] + ) + component_list.append(origin_name_component) # Duplicate thumbnail component for all not first reviews if first_thumbnail_component is not None: From f42831ecb04d163e647f68db8b008530926de81e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 17 Feb 2023 10:48:48 +0100 Subject: [PATCH 23/32] added settings for original basename upload --- .../defaults/project_settings/ftrack.json | 3 ++- .../projects_schema/schema_project_ftrack.json | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index cdf861df4a..f3f2345a0f 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -488,7 +488,8 @@ }, "keep_first_subset_name_for_review": true, "asset_versions_status_profiles": [], - "additional_metadata_keys": [] + "additional_metadata_keys": [], + "upload_reviewable_with_origin_name": false }, "IntegrateFtrackFarmStatus": { "farm_status_profiles": [] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json b/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json index da414cc961..7050721742 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_ftrack.json @@ -1037,6 +1037,21 @@ {"fps": "FPS"}, {"code": "Codec"} ] + }, + { + "type": "separator" + }, + { + "type": "boolean", + "key": "upload_reviewable_with_origin_name", + "label": "Upload reviewable with origin name" + }, + { + "type": "label", + "label": "Note: Reviewable will be uploaded twice into ftrack when enabled. One with original name and second with required 'ftrackreview-mp4'. That may cause dramatic increase of ftrack storage usage." + }, + { + "type": "separator" } ] }, From 9d600e45880c8e8ab107b87ff14495003d1a76a9 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 17 Feb 2023 13:20:29 +0100 Subject: [PATCH 24/32] OP-4974 - fix - missing set of frame range when opening scene Added check for not up-to-date loaded containers. --- openpype/hosts/harmony/api/pipeline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/harmony/api/pipeline.py b/openpype/hosts/harmony/api/pipeline.py index 4b9849c190..686770b64e 100644 --- a/openpype/hosts/harmony/api/pipeline.py +++ b/openpype/hosts/harmony/api/pipeline.py @@ -126,10 +126,6 @@ def check_inventory(): def application_launch(event): """Event that is executed after Harmony is launched.""" - # FIXME: This is breaking server <-> client communication. - # It is now moved so it it manually called. - # ensure_scene_settings() - # check_inventory() # fills OPENPYPE_HARMONY_JS pype_harmony_path = Path(__file__).parent.parent / "js" / "PypeHarmony.js" pype_harmony_js = pype_harmony_path.read_text() @@ -146,6 +142,9 @@ def application_launch(event): harmony.send({"script": script}) inject_avalon_js() + ensure_scene_settings() + check_inventory() + def export_template(backdrops, nodes, filepath): """Export Template to file. From aaba8c1f7be4dca894ab51c6a84092b9759e88e8 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 20 Feb 2023 07:37:50 +0000 Subject: [PATCH 25/32] Fix attributes --- openpype/settings/defaults/project_anatomy/attributes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_anatomy/attributes.json b/openpype/settings/defaults/project_anatomy/attributes.json index 0cc414fb69..bf8bbef8de 100644 --- a/openpype/settings/defaults/project_anatomy/attributes.json +++ b/openpype/settings/defaults/project_anatomy/attributes.json @@ -23,4 +23,4 @@ ], "tools_env": [], "active": true -} +} \ No newline at end of file From 5e203ec6306da50cabca6efab09c4a679b451228 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 20 Feb 2023 16:06:48 +0000 Subject: [PATCH 26/32] Only submit version when running from build. --- .../plugins/publish/submit_aftereffects_deadline.py | 7 ++++++- .../deadline/plugins/publish/submit_harmony_deadline.py | 9 +++++++-- .../plugins/publish/submit_houdini_remote_publish.py | 9 +++++++-- .../plugins/publish/submit_houdini_render_deadline.py | 9 +++++++-- .../deadline/plugins/publish/submit_maya_deadline.py | 9 +++++++-- .../publish/submit_maya_remote_publish_deadline.py | 9 +++++++-- .../deadline/plugins/publish/submit_nuke_deadline.py | 9 +++++++-- .../deadline/plugins/publish/submit_publish_job.py | 8 ++++++-- 8 files changed, 54 insertions(+), 15 deletions(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py b/openpype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py index f26047bb9d..83dd5b49e2 100644 --- a/openpype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py @@ -12,6 +12,7 @@ from openpype.pipeline import legacy_io from openpype_modules.deadline import abstract_submit_deadline from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build @attr.s @@ -87,9 +88,13 @@ class AfterEffectsSubmitDeadline( "AVALON_APP_NAME", "OPENPYPE_DEV", "OPENPYPE_LOG_NO_COLORS", - "OPENPYPE_VERSION", "IS_TEST" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if self._instance.context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_harmony_deadline.py b/openpype/modules/deadline/plugins/publish/submit_harmony_deadline.py index 425883393f..84fca11d9d 100644 --- a/openpype/modules/deadline/plugins/publish/submit_harmony_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_harmony_deadline.py @@ -14,6 +14,7 @@ from openpype.pipeline import legacy_io from openpype_modules.deadline import abstract_submit_deadline from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build class _ZipFile(ZipFile): @@ -279,10 +280,14 @@ class HarmonySubmitDeadline( "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", - "OPENPYPE_VERSION", + "OPENPYPE_LOG_NO_COLORS" "IS_TEST" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if self._instance.context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_remote_publish.py b/openpype/modules/deadline/plugins/publish/submit_houdini_remote_publish.py index 6a62f83cae..68aa653804 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_remote_publish.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_remote_publish.py @@ -9,6 +9,7 @@ import pyblish.api from openpype.pipeline import legacy_io from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build class HoudiniSubmitPublishDeadline(pyblish.api.ContextPlugin): @@ -133,9 +134,13 @@ class HoudiniSubmitPublishDeadline(pyblish.api.ContextPlugin): # Submit along the current Avalon tool setup that we launched # this application with so the Render Slave can build its own # similar environment using it, e.g. "houdini17.5;pluginx2.3" - "AVALON_TOOLS", - "OPENPYPE_VERSION" + "AVALON_TOOLS" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 2b17b644b8..73ab689c9a 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -10,6 +10,7 @@ import pyblish.api from openpype.pipeline import legacy_io from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build class HoudiniSubmitRenderDeadline(pyblish.api.InstancePlugin): @@ -105,9 +106,13 @@ class HoudiniSubmitRenderDeadline(pyblish.api.InstancePlugin): # Submit along the current Avalon tool setup that we launched # this application with so the Render Slave can build its own # similar environment using it, e.g. "maya2018;vray4.x;yeti3.1.9" - "AVALON_TOOLS", - "OPENPYPE_VERSION" + "AVALON_TOOLS" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_maya_deadline.py b/openpype/modules/deadline/plugins/publish/submit_maya_deadline.py index ed37ff1897..22b5c02296 100644 --- a/openpype/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -38,6 +38,7 @@ from openpype.hosts.maya.api.lib import get_attr_in_layer from openpype_modules.deadline import abstract_submit_deadline from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build def _validate_deadline_bool_value(instance, attribute, value): @@ -165,10 +166,14 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", - "OPENPYPE_VERSION", + "OPENPYPE_DEV" "IS_TEST" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if self._instance.context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py b/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py index bab6591c7f..25f859554f 100644 --- a/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py @@ -7,6 +7,7 @@ from maya import cmds from openpype.pipeline import legacy_io, PublishXmlValidationError from openpype.settings import get_project_settings from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build import pyblish.api @@ -104,9 +105,13 @@ class MayaSubmitRemotePublishDeadline(pyblish.api.InstancePlugin): keys = [ "FTRACK_API_USER", "FTRACK_API_KEY", - "FTRACK_SERVER", - "OPENPYPE_VERSION" + "FTRACK_SERVER" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + environment = dict({key: os.environ[key] for key in keys if key in os.environ}, **legacy_io.Session) diff --git a/openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py b/openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py index d1948d8d50..cca2a4d896 100644 --- a/openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py @@ -10,6 +10,7 @@ import pyblish.api import nuke from openpype.pipeline import legacy_io from openpype.tests.lib import is_in_tests +from openpype.lib import is_running_from_build class NukeSubmitDeadline(pyblish.api.InstancePlugin): @@ -265,9 +266,13 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): "PYBLISHPLUGINPATH", "NUKE_PATH", "TOOL_ENV", - "FOUNDRY_LICENSE", - "OPENPYPE_VERSION" + "FOUNDRY_LICENSE" ] + + # Add OpenPype version if we are running from build. + if is_running_from_build(): + keys.append("OPENPYPE_VERSION") + # Add mongo url if it's enabled if instance.context.data.get("deadlinePassMongoUrl"): keys.append("OPENPYPE_MONGO") diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 8f8f4246dd..e132d7323b 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -20,6 +20,7 @@ from openpype.pipeline import ( ) from openpype.tests.lib import is_in_tests from openpype.pipeline.farm.patterning import match_aov_pattern +from openpype.lib import is_running_from_build def get_resources(project_name, version, extension=None): @@ -136,10 +137,13 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "FTRACK_API_KEY", "FTRACK_SERVER", "AVALON_APP_NAME", - "OPENPYPE_USERNAME", - "OPENPYPE_VERSION" + "OPENPYPE_USERNAME" ] + # Add OpenPype version if we are running from build. + if is_running_from_build(): + environ_keys.append("OPENPYPE_VERSION") + # custom deadline attributes deadline_department = "" deadline_pool = "" From 72134d4a211ee325799c439a31fded53c41b04a9 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 20 Feb 2023 18:33:15 +0100 Subject: [PATCH 27/32] Fix changed location of reset_frame_range Location in commands caused cyclic import --- openpype/hosts/maya/api/commands.py | 49 ------------------- openpype/hosts/maya/api/lib.py | 49 ++++++++++++++++++- openpype/hosts/maya/api/lib_rendersettings.py | 2 +- openpype/hosts/maya/api/menu.py | 3 +- 4 files changed, 50 insertions(+), 53 deletions(-) diff --git a/openpype/hosts/maya/api/commands.py b/openpype/hosts/maya/api/commands.py index 19ad18d824..018340d86c 100644 --- a/openpype/hosts/maya/api/commands.py +++ b/openpype/hosts/maya/api/commands.py @@ -4,7 +4,6 @@ from maya import cmds from openpype.client import get_asset_by_name, get_project from openpype.pipeline import legacy_io -from . import lib class ToolWindows: @@ -58,54 +57,6 @@ def edit_shader_definitions(): window.show() -def reset_frame_range(): - """Set frame range to current asset""" - - fps = lib.convert_to_maya_fps( - float(legacy_io.Session.get("AVALON_FPS", 25)) - ) - lib.set_scene_fps(fps) - - # Set frame start/end - project_name = legacy_io.active_project() - asset_name = legacy_io.Session["AVALON_ASSET"] - asset = get_asset_by_name(project_name, asset_name) - - frame_start = asset["data"].get("frameStart") - frame_end = asset["data"].get("frameEnd") - # Backwards compatibility - if frame_start is None or frame_end is None: - frame_start = asset["data"].get("edit_in") - frame_end = asset["data"].get("edit_out") - - if frame_start is None or frame_end is None: - cmds.warning("No edit information found for %s" % asset_name) - return - - handles = asset["data"].get("handles") or 0 - handle_start = asset["data"].get("handleStart") - if handle_start is None: - handle_start = handles - - handle_end = asset["data"].get("handleEnd") - if handle_end is None: - handle_end = handles - - frame_start -= int(handle_start) - frame_end += int(handle_end) - - cmds.playbackOptions(minTime=frame_start) - cmds.playbackOptions(maxTime=frame_end) - cmds.playbackOptions(animationStartTime=frame_start) - cmds.playbackOptions(animationEndTime=frame_end) - cmds.playbackOptions(minTime=frame_start) - cmds.playbackOptions(maxTime=frame_end) - cmds.currentTime(frame_start) - - cmds.setAttr("defaultRenderGlobals.startFrame", frame_start) - cmds.setAttr("defaultRenderGlobals.endFrame", frame_end) - - def _resolution_from_document(doc): if not doc or "data" not in doc: print("Entered document is not valid. \"{}\"".format(str(doc))) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index b920428b20..84c6e6929d 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -34,7 +34,6 @@ from openpype.pipeline import ( registered_host, ) from openpype.pipeline.context_tools import get_current_project_asset -from .commands import reset_frame_range self = sys.modules[__name__] @@ -2065,6 +2064,54 @@ def set_scene_resolution(width, height, pixelAspect): cmds.setAttr("%s.pixelAspect" % control_node, pixelAspect) +def reset_frame_range(): + """Set frame range to current asset""" + + fps = convert_to_maya_fps( + float(legacy_io.Session.get("AVALON_FPS", 25)) + ) + set_scene_fps(fps) + + # Set frame start/end + project_name = legacy_io.active_project() + asset_name = legacy_io.Session["AVALON_ASSET"] + asset = get_asset_by_name(project_name, asset_name) + + frame_start = asset["data"].get("frameStart") + frame_end = asset["data"].get("frameEnd") + # Backwards compatibility + if frame_start is None or frame_end is None: + frame_start = asset["data"].get("edit_in") + frame_end = asset["data"].get("edit_out") + + if frame_start is None or frame_end is None: + cmds.warning("No edit information found for %s" % asset_name) + return + + handles = asset["data"].get("handles") or 0 + handle_start = asset["data"].get("handleStart") + if handle_start is None: + handle_start = handles + + handle_end = asset["data"].get("handleEnd") + if handle_end is None: + handle_end = handles + + frame_start -= int(handle_start) + frame_end += int(handle_end) + + cmds.playbackOptions(minTime=frame_start) + cmds.playbackOptions(maxTime=frame_end) + cmds.playbackOptions(animationStartTime=frame_start) + cmds.playbackOptions(animationEndTime=frame_end) + cmds.playbackOptions(minTime=frame_start) + cmds.playbackOptions(maxTime=frame_end) + cmds.currentTime(frame_start) + + cmds.setAttr("defaultRenderGlobals.startFrame", frame_start) + cmds.setAttr("defaultRenderGlobals.endFrame", frame_end) + + def reset_scene_resolution(): """Apply the scene resolution from the project definition diff --git a/openpype/hosts/maya/api/lib_rendersettings.py b/openpype/hosts/maya/api/lib_rendersettings.py index 6190a49401..2a730100de 100644 --- a/openpype/hosts/maya/api/lib_rendersettings.py +++ b/openpype/hosts/maya/api/lib_rendersettings.py @@ -14,7 +14,7 @@ from openpype.settings import ( from openpype.pipeline import legacy_io from openpype.pipeline import CreatorError from openpype.pipeline.context_tools import get_current_project_asset -from openpype.hosts.maya.api.commands import reset_frame_range +from openpype.hosts.maya.api.lib import reset_frame_range class RenderSettings(object): diff --git a/openpype/hosts/maya/api/menu.py b/openpype/hosts/maya/api/menu.py index 791475173f..0f48a133a6 100644 --- a/openpype/hosts/maya/api/menu.py +++ b/openpype/hosts/maya/api/menu.py @@ -12,7 +12,6 @@ from openpype.pipeline.workfile import BuildWorkfile from openpype.tools.utils import host_tools from openpype.hosts.maya.api import lib, lib_rendersettings from .lib import get_main_window, IS_HEADLESS -from .commands import reset_frame_range from .workfile_template_builder import ( create_placeholder, @@ -113,7 +112,7 @@ def install(): cmds.menuItem( "Reset Frame Range", - command=lambda *args: reset_frame_range() + command=lambda *args: lib.reset_frame_range() ) cmds.menuItem( From 373b1abffc44a2be38643d28131ee0abefe3c52c Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 21 Feb 2023 07:21:30 +0000 Subject: [PATCH 28/32] Ensure viewport options work ahead of playblasting. --- .../maya/plugins/publish/extract_playblast.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_playblast.py b/openpype/hosts/maya/plugins/publish/extract_playblast.py index 1f9f9db99a..fe7e83a84b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_playblast.py +++ b/openpype/hosts/maya/plugins/publish/extract_playblast.py @@ -119,6 +119,24 @@ class ExtractPlayblast(publish.Extractor): pan_zoom = cmds.getAttr("{}.panZoomEnabled".format(preset["camera"])) cmds.setAttr("{}.panZoomEnabled".format(preset["camera"]), False) + # Need to explicitly enable some viewport changes so the viewport is + # refreshed ahead of playblasting. + panel = cmds.getPanel(withFocus=True) + keys = [ + "useDefaultMaterial", + "wireframeOnShaded", + "xray", + "jointXray", + "backfaceCulling" + ] + viewport_defaults = {} + for key in keys: + viewport_defaults[key] = cmds.modelEditor( + panel, query=True, **{key: True} + ) + if preset["viewport_options"][key]: + cmds.modelEditor(panel, edit=True, **{key: True}) + with lib.maintained_time(): filename = preset.get("filename", "%TEMP%") @@ -139,6 +157,10 @@ class ExtractPlayblast(publish.Extractor): path = capture.capture(log=self.log, **preset) + # Restoring viewport options. + for key, value in viewport_defaults.items(): + cmds.modelEditor(panel, edit=True, **{key: value}) + cmds.setAttr("{}.panZoomEnabled".format(preset["camera"]), pan_zoom) self.log.debug("playblast path {}".format(path)) From 38c9330caef225e4ab632f5834c92fff5a3ea8b9 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 21 Feb 2023 10:41:48 +0100 Subject: [PATCH 29/32] returning nightly builds --- .github/workflows/nightly_merge.yml | 29 +++++++++++++ .github/workflows/prerelease.yml | 67 +++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/nightly_merge.yml create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/nightly_merge.yml b/.github/workflows/nightly_merge.yml new file mode 100644 index 0000000000..1776d7a464 --- /dev/null +++ b/.github/workflows/nightly_merge.yml @@ -0,0 +1,29 @@ +name: Dev -> Main + +on: + schedule: + - cron: '21 3 * * 3,6' + workflow_dispatch: + +jobs: + develop-to-main: + + runs-on: ubuntu-latest + + steps: + - name: 🚛 Checkout Code + uses: actions/checkout@v2 + + - name: 🔨 Merge develop to main + uses: everlytic/branch-merge@1.1.0 + with: + github_token: ${{ secrets.YNPUT_BOT_TOKEN }} + source_ref: 'develop' + target_branch: 'main' + commit_message_template: '[Automated] Merged {source_ref} into {target_branch}' + + - name: Invoke pre-release workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: Nightly Prerelease + token: ${{ secrets.YNPUT_BOT_TOKEN }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000000..571b0339e1 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,67 @@ +name: Nightly Prerelease + +on: + workflow_dispatch: + + +jobs: + create_nightly: + runs-on: ubuntu-latest + + steps: + - name: 🚛 Checkout Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install Python requirements + run: pip install gitpython semver PyGithub + + - name: 🔎 Determine next version type + id: version_type + run: | + TYPE=$(python ./tools/ci_tools.py --bump --github_token ${{ secrets.YNPUT_BOT_TOKEN }}) + echo "type=${TYPE}" >> $GITHUB_OUTPUT + + - name: 💉 Inject new version into files + id: version + if: steps.version_type.outputs.type != 'skip' + run: | + NEW_VERSION_TAG=$(python ./tools/ci_tools.py --nightly --github_token ${{ secrets.YNPUT_BOT_TOKEN }}) + echo "next_tag=${NEW_VERSION_TAG}" >> $GITHUB_OUTPUT + + - name: 💾 Commit and Tag + id: git_commit + if: steps.version_type.outputs.type != 'skip' + run: | + git config user.email ${{ secrets.CI_EMAIL }} + git config user.name ${{ secrets.CI_USER }} + git checkout main + git pull + git add . + git commit -m "[Automated] Bump version" + tag_name="CI/${{ steps.version.outputs.next_tag }}" + echo $tag_name + git tag -a $tag_name -m "nightly build" + + - name: Push to protected main branch + uses: CasperWA/push-protected@v2.10.0 + with: + token: ${{ secrets.YNPUT_BOT_TOKEN }} + branch: main + tags: true + unprotect_reviews: true + + - name: 🔨 Merge main back to develop + uses: everlytic/branch-merge@1.1.0 + if: steps.version_type.outputs.type != 'skip' + with: + github_token: ${{ secrets.YNPUT_BOT_TOKEN }} + source_ref: 'main' + target_branch: 'develop' + commit_message_template: '[Automated] Merged {source_ref} into {target_branch}' From 1d0952014314217b022dffea7340db8776041a54 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 21 Feb 2023 15:18:07 +0000 Subject: [PATCH 30/32] Update openpype/hosts/maya/plugins/publish/extract_playblast.py Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- openpype/hosts/maya/plugins/publish/extract_playblast.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_playblast.py b/openpype/hosts/maya/plugins/publish/extract_playblast.py index f85772886b..1966ad7b66 100644 --- a/openpype/hosts/maya/plugins/publish/extract_playblast.py +++ b/openpype/hosts/maya/plugins/publish/extract_playblast.py @@ -163,8 +163,7 @@ class ExtractPlayblast(publish.Extractor): path = capture.capture(log=self.log, **preset) # Restoring viewport options. - for key, value in viewport_defaults.items(): - cmds.modelEditor(panel, edit=True, **{key: value}) + cmds.modelEditor(panel, edit=True, **viewport_defaults) cmds.setAttr("{}.panZoomEnabled".format(preset["camera"]), pan_zoom) From d08c979a2145ea46d66c52408913081d3f4486e6 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 20 Feb 2023 08:07:38 +0000 Subject: [PATCH 31/32] Fix setting scene fps with float input --- openpype/hosts/maya/api/lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 84c6e6929d..509168278c 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -1997,7 +1997,7 @@ def set_scene_fps(fps, update=True): '48000': '48000fps' } - unit = fps_mapping.get(str(fps), None) + unit = fps_mapping.get(str(convert_to_maya_fps(fps)), None) if unit is None: raise ValueError("Unsupported FPS value: `%s`" % fps) @@ -3454,11 +3454,11 @@ def convert_to_maya_fps(fps): # If input fps is a whole number we'll return. if float(fps).is_integer(): # Validate fps is part of Maya's fps selection. - if fps not in int_framerates: + if int(fps) not in int_framerates: raise ValueError( "Framerate \"{}\" is not supported in Maya".format(fps) ) - return fps + return int(fps) else: # Differences to supported float frame rates. differences = [] From 17c666d2f398406afacc6e8b5b1d8c12039e5bed Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 20 Feb 2023 11:47:47 +0000 Subject: [PATCH 32/32] Code cosmetics. --- openpype/hosts/maya/plugins/publish/validate_maya_units.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_maya_units.py b/openpype/hosts/maya/plugins/publish/validate_maya_units.py index ad256b6a72..357dde692c 100644 --- a/openpype/hosts/maya/plugins/publish/validate_maya_units.py +++ b/openpype/hosts/maya/plugins/publish/validate_maya_units.py @@ -4,7 +4,6 @@ import pyblish.api import openpype.hosts.maya.api.lib as mayalib from openpype.pipeline.context_tools import get_current_project_asset -from math import ceil from openpype.pipeline.publish import ( RepairContextAction, ValidateSceneOrder,