From b940dddaa979ebf97a9114a3023083b396c1c83a Mon Sep 17 00:00:00 2001 From: jezscha Date: Mon, 7 Jun 2021 08:23:49 +0000 Subject: [PATCH 01/12] Create draft PR for #1651 From fe794a26535496a7b1efb38111714b60f21a7439 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 7 Jun 2021 12:01:12 +0200 Subject: [PATCH 02/12] Nuke: refactory prenode write node creation --- openpype/hosts/nuke/api/lib.py | 54 ++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 3c41574dbf..7c274a03c7 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -298,18 +298,21 @@ def create_write_node(name, data, input=None, prenodes=None, review=True): review (bool): adding review knob Example: - prenodes = [( - "NameNode", # string - "NodeClass", # string - ( # OrderDict: knob and values pairs - ("knobName", "knobValue"), - ("knobName", "knobValue") - ), - ( # list outputs - "firstPostNodeName", - "secondPostNodeName" - ) - ) + prenodes = [ + { + "nodeName": { + "class": "" # string + "knobs": [ + ("knobName": value), + ... + ], + "dependent": [ + following_node_01, + ... + ] + } + }, + ... ] Return: @@ -385,35 +388,42 @@ def create_write_node(name, data, input=None, prenodes=None, review=True): prev_node.hideControlPanel() # creating pre-write nodes `prenodes` if prenodes: - for name, klass, properties, set_output_to in prenodes: + for node in prenodes: + # get attributes + name = node["name"] + klass = node["class"] + knobs = node["knobs"] + dependent = node["dependent"] + # create node now_node = nuke.createNode(klass, "name {}".format(name)) now_node.hideControlPanel() # add data to knob - for k, v in properties: + for _knob in knobs: + knob, value = _knob try: - now_node[k].value() + now_node[knob].value() except NameError: log.warning( "knob `{}` does not exist on node `{}`".format( - k, now_node["name"].value() + knob, now_node["name"].value() )) continue - if k and v: - now_node[k].setValue(str(v)) + if knob and value: + now_node[knob].setValue(value) # connect to previous node - if set_output_to: - if isinstance(set_output_to, (tuple or list)): - for i, node_name in enumerate(set_output_to): + if dependent: + if isinstance(dependent, (tuple or list)): + for i, node_name in enumerate(dependent): input_node = nuke.createNode( "Input", "name {}".format(node_name)) input_node.hideControlPanel() now_node.setInput(1, input_node) - elif isinstance(set_output_to, str): + elif isinstance(dependent, str): input_node = nuke.createNode( "Input", "name {}".format(node_name)) input_node.hideControlPanel() From e723e456347e6b544aed3d2c783610d388497498 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 7 Jun 2021 12:01:33 +0200 Subject: [PATCH 03/12] Nuke: adding crop node before write node --- .../plugins/create/create_write_render.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/nuke/plugins/create/create_write_render.py b/openpype/hosts/nuke/plugins/create/create_write_render.py index 04983e9c75..9ddf0e4a87 100644 --- a/openpype/hosts/nuke/plugins/create/create_write_render.py +++ b/openpype/hosts/nuke/plugins/create/create_write_render.py @@ -99,10 +99,28 @@ class CreateWriteRender(plugin.PypeCreator): "fpath_template": ("{work}/renders/nuke/{subset}" "/{subset}.{frame}.{ext}")}) + # add crop node to cut off all outside of format bounding box + _prenodes = [ + { + "name": "Crop01", + "class": "Crop", + "knobs": [ + ("box", [ + 0.0, + 0.0, + selected_node.width(), + selected_node.height() + ]) + ], + "dependent": None + } + ] + write_node = lib.create_write_node( self.data["subset"], write_data, - input=selected_node) + input=selected_node, + prenodes=_prenodes) # relinking to collected connections for i, input in enumerate(inputs): From 50ab558291e487fcf2883351ea48aea82d409fda Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 7 Jun 2021 12:05:15 +0200 Subject: [PATCH 04/12] Nuke: removing `ValidateNukeWriteBoundingBox` plugin and settings --- .../publish/validate_write_bounding_box.py | 106 ------------------ .../defaults/project_settings/nuke.json | 5 - .../schemas/schema_nuke_publish.json | 4 - 3 files changed, 115 deletions(-) delete mode 100644 openpype/hosts/nuke/plugins/publish/validate_write_bounding_box.py diff --git a/openpype/hosts/nuke/plugins/publish/validate_write_bounding_box.py b/openpype/hosts/nuke/plugins/publish/validate_write_bounding_box.py deleted file mode 100644 index e4b7c77a25..0000000000 --- a/openpype/hosts/nuke/plugins/publish/validate_write_bounding_box.py +++ /dev/null @@ -1,106 +0,0 @@ -import nuke - -import pyblish.api - - -class RepairNukeBoundingBoxAction(pyblish.api.Action): - - label = "Repair" - icon = "wrench" - on = "failed" - - def process(self, context, plugin): - - # Get the errored instances - failed = [] - for result in context.data["results"]: - if (result["error"] is not None and result["instance"] is not None - and result["instance"] not in failed): - failed.append(result["instance"]) - - # Apply pyblish.logic to get the instances for the plug-in - instances = pyblish.api.instances_by_plugin(failed, plugin) - - for instance in instances: - crop = instance[0].dependencies()[0] - if crop.Class() != "Crop": - crop = nuke.nodes.Crop(inputs=[instance[0].input(0)]) - - xpos = instance[0].xpos() - ypos = instance[0].ypos() - 26 - - dependent_ypos = instance[0].dependencies()[0].ypos() - if (instance[0].ypos() - dependent_ypos) <= 51: - xpos += 110 - - crop.setXYpos(xpos, ypos) - - instance[0].setInput(0, crop) - - crop["box"].setValue( - ( - 0.0, - 0.0, - instance[0].input(0).width(), - instance[0].input(0).height() - ) - ) - - -class ValidateNukeWriteBoundingBox(pyblish.api.InstancePlugin): - """Validates write bounding box. - - Ffmpeg does not support bounding boxes outside of the image - resolution a crop is needed. This needs to validate all frames, as each - rendered exr can break the ffmpeg transcode. - """ - - order = pyblish.api.ValidatorOrder - optional = True - families = ["render", "render.local", "render.farm"] - label = "Write Bounding Box" - hosts = ["nuke"] - actions = [RepairNukeBoundingBoxAction] - - def process(self, instance): - - # Skip bounding box check if a crop node exists. - if instance[0].dependencies()[0].Class() == "Crop": - return - - msg = "Bounding box is outside the format." - assert self.check_bounding_box(instance), msg - - def check_bounding_box(self, instance): - node = instance[0] - - first_frame = instance.data["frameStart"] - last_frame = instance.data["frameEnd"] - - format_width = node.format().width() - format_height = node.format().height() - - # The trick is that we need to execute() some node every time we go to - # a next frame, to update the context. - # So we create a CurveTool that we can execute() on every frame. - temporary_node = nuke.nodes.CurveTool() - bbox_check = True - for frame in range(first_frame, last_frame + 1): - # Workaround to update the tree - nuke.execute(temporary_node, frame, frame) - - x = node.bbox().x() - y = node.bbox().y() - w = node.bbox().w() - h = node.bbox().h() - - if x < 0 or (x + w) > format_width: - bbox_check = False - break - - if y < 0 or (y + h) > format_height: - bbox_check = False - break - - nuke.delete(temporary_node) - return bbox_check diff --git a/openpype/settings/defaults/project_settings/nuke.json b/openpype/settings/defaults/project_settings/nuke.json index 13e1924b36..3736f67268 100644 --- a/openpype/settings/defaults/project_settings/nuke.json +++ b/openpype/settings/defaults/project_settings/nuke.json @@ -43,11 +43,6 @@ "optional": true, "active": true }, - "ValidateNukeWriteBoundingBox": { - "enabled": true, - "optional": true, - "active": true - }, "ExtractThumbnail": { "enabled": true, "nodes": { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_publish.json index 087e6c13a9..6873ed5190 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_nuke_publish.json @@ -64,10 +64,6 @@ { "key": "ValidateScript", "label": "Validate script settings" - }, - { - "key": "ValidateNukeWriteBoundingBox", - "label": "Validate and Write Bounding Box" } ] }, From 5cf841b2ef4a2147a9a79b0feed0eac07e6d9839 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 8 Jun 2021 12:08:45 +0200 Subject: [PATCH 05/12] add new process information to mac launch arguments --- openpype/hooks/pre_mac_launch.py | 2 +- openpype/modules/standalonepublish_action.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hooks/pre_mac_launch.py b/openpype/hooks/pre_mac_launch.py index 3f07ae07db..f85557a4f0 100644 --- a/openpype/hooks/pre_mac_launch.py +++ b/openpype/hooks/pre_mac_launch.py @@ -31,4 +31,4 @@ class LaunchWithTerminal(PreLaunchHook): if len(self.launch_context.launch_args) > 1: self.launch_context.launch_args.insert(1, "--args") # Prepend open arguments - self.launch_context.launch_args.insert(0, ["open", "-a"]) + self.launch_context.launch_args.insert(0, ["open", "-na"]) diff --git a/openpype/modules/standalonepublish_action.py b/openpype/modules/standalonepublish_action.py index 78d87cb6c7..4f87f9704c 100644 --- a/openpype/modules/standalonepublish_action.py +++ b/openpype/modules/standalonepublish_action.py @@ -37,7 +37,7 @@ class StandAlonePublishAction(PypeModule, ITrayAction): args = get_pype_execute_args("standalonepublisher") kwargs = {} if platform.system().lower() == "darwin": - new_args = ["open", "-a", args.pop(0), "--args"] + new_args = ["open", "-na", args.pop(0), "--args"] new_args.extend(args) args = new_args From f1c858fa7d8127f25160e5c14d4584c366cc5a4a Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Tue, 8 Jun 2021 17:41:30 +0200 Subject: [PATCH 06/12] add trigger for prerelease --- .github/workflows/nightly_merge.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly_merge.yml b/.github/workflows/nightly_merge.yml index 9e6a721f99..98d8cd41f3 100644 --- a/.github/workflows/nightly_merge.yml +++ b/.github/workflows/nightly_merge.yml @@ -1,4 +1,4 @@ -name: Nightly Merge +name: Merge Develop to Main on: schedule: @@ -20,4 +20,10 @@ jobs: github_token: ${{ secrets.ADMIN_TOKEN }} source_ref: 'develop' target_branch: 'main' - commit_message_template: '[Automated] Merged {source_ref} into {target_branch}' \ No newline at end of file + 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.ADMIN_TOKEN }} \ No newline at end of file From 667e344b3d6f18c2d6e9bd9f6331c3503e7fb72f Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Tue, 8 Jun 2021 17:56:16 +0200 Subject: [PATCH 07/12] only run prerelease on dispatch --- .github/workflows/prerelease.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 63c7e8081f..45604e431d 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,15 +1,12 @@ name: Nightly Prerelease on: - push: - branches: [main] workflow_dispatch: jobs: create_nightly: runs-on: ubuntu-latest - if: github.actor != 'pypebot' steps: - name: 🚛 Checkout Code From a5a9465a9f0ee20c0c1f3dec926bd7cfd5265450 Mon Sep 17 00:00:00 2001 From: OpenPype Date: Tue, 8 Jun 2021 16:01:10 +0000 Subject: [PATCH 08/12] [Automated] Bump version --- CHANGELOG.md | 4 +++- openpype/version.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb7866420..9fae98ec11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,17 @@ # Changelog -## [3.1.0-nightly.1](https://github.com/pypeclub/OpenPype/tree/HEAD) +## [3.1.0-nightly.2](https://github.com/pypeclub/OpenPype/tree/HEAD) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.0.0...HEAD) #### 🚀 Enhancements +- Nuke - Publish simplification [\#1653](https://github.com/pypeclub/OpenPype/pull/1653) - \#1333 - added tooltip hints to Pyblish buttons [\#1649](https://github.com/pypeclub/OpenPype/pull/1649) #### 🐛 Bug fixes +- Mac launch arguments fix [\#1660](https://github.com/pypeclub/OpenPype/pull/1660) - Fix missing dbm python module [\#1652](https://github.com/pypeclub/OpenPype/pull/1652) - Transparent branches in view on Mac [\#1648](https://github.com/pypeclub/OpenPype/pull/1648) - Add asset on task item [\#1646](https://github.com/pypeclub/OpenPype/pull/1646) diff --git a/openpype/version.py b/openpype/version.py index 24ceaccea9..d6d6a4544b 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.1.0-nightly.1" +__version__ = "3.1.0-nightly.2" From 617ed02ef5a4d77fc81a6906450bfbef22e26356 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Wed, 9 Jun 2021 16:27:38 +0200 Subject: [PATCH 09/12] Update README.md remove requirements badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 566e226538..6b4495c9b6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ OpenPype ==== -[![documentation](https://github.com/pypeclub/pype/actions/workflows/documentation.yml/badge.svg)](https://github.com/pypeclub/pype/actions/workflows/documentation.yml) ![GitHub Requirements](https://img.shields.io/requires/github/pypeclub/pype?labelColor=303846) ![GitHub VFX Platform](https://img.shields.io/badge/vfx%20platform-2021-lightgrey?labelColor=303846) +[![documentation](https://github.com/pypeclub/pype/actions/workflows/documentation.yml/badge.svg)](https://github.com/pypeclub/pype/actions/workflows/documentation.yml) ![GitHub VFX Platform](https://img.shields.io/badge/vfx%20platform-2021-lightgrey?labelColor=303846) From f9ab24c539d85992f9a12f01522997a40eadc3db Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Wed, 9 Jun 2021 16:41:31 +0200 Subject: [PATCH 10/12] rename workflow --- .github/workflows/nightly_merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly_merge.yml b/.github/workflows/nightly_merge.yml index 98d8cd41f3..8b8792cb62 100644 --- a/.github/workflows/nightly_merge.yml +++ b/.github/workflows/nightly_merge.yml @@ -1,4 +1,4 @@ -name: Merge Develop to Main +name: Dev -> Main on: schedule: From ede5013dbd44fe5b66c3efd779e348a733921bed Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Jun 2021 18:10:34 +0200 Subject: [PATCH 11/12] trigger set_entity_value on add_row after new item is part of input_fields --- openpype/tools/settings/settings/list_item_widget.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openpype/tools/settings/settings/list_item_widget.py b/openpype/tools/settings/settings/list_item_widget.py index e1990d0bf6..82ca541132 100644 --- a/openpype/tools/settings/settings/list_item_widget.py +++ b/openpype/tools/settings/settings/list_item_widget.py @@ -100,7 +100,6 @@ class ListItem(QtWidgets.QWidget): self.input_field = self.create_ui_for_entity( self.category_widget, self.entity, self ) - self.input_field.set_entity_value() spacer_widget = QtWidgets.QWidget(self) spacer_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) @@ -337,6 +336,12 @@ class ListWidget(InputWidget): self.content_layout.insertWidget(row + 1, item_widget) self.input_fields.insert(row, item_widget) + # Change to entity value after item is added to `input_fields` + # - may cause recursion error as setting a value may cause input field + # change which will trigger this validation if entity is already + # added as widget here which won't because is not in input_fields + item_widget.input_field.set_entity_value() + if previous_field: previous_field.order_changed() From d199fad0e66d1982ba2e889e80c79e49a7b59fd1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Jun 2021 18:15:08 +0200 Subject: [PATCH 12/12] fix another unrelated issue in DictMutableKeysEntity --- openpype/settings/entities/dict_mutable_keys_entity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/entities/dict_mutable_keys_entity.py b/openpype/settings/entities/dict_mutable_keys_entity.py index 4b221720c3..3c2645e3e5 100644 --- a/openpype/settings/entities/dict_mutable_keys_entity.py +++ b/openpype/settings/entities/dict_mutable_keys_entity.py @@ -467,7 +467,7 @@ class DictMutableKeysEntity(EndpointEntity): if self.store_as_list: output = [] for key, child_entity in self.children_by_key.items(): - output.append(key, child_entity.value) + output.append([key, child_entity.value]) return output output = {}