From 95755a4f6134daa6e1b374a63ea98c97594706e4 Mon Sep 17 00:00:00 2001 From: Michael <11843596+MichaelAldrich@users.noreply.github.com> Date: Tue, 14 May 2024 16:21:50 -0400 Subject: [PATCH 1/9] + Add button to open logs directory --- nxt_editor/main_window.py | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/nxt_editor/main_window.py b/nxt_editor/main_window.py index 9cf6f22..13cee1f 100644 --- a/nxt_editor/main_window.py +++ b/nxt_editor/main_window.py @@ -8,6 +8,7 @@ import webbrowser from functools import partial import time +import tempfile # External from Qt import QtWidgets @@ -1252,6 +1253,8 @@ def __init__(self, parent=None): # Help Menu self.help_menu = self.addMenu('Help') self.help_menu.setTearOffEnabled(True) + logs_dir_action = self.help_menu.addAction('Open Logs Dir') + logs_dir_action.triggered.connect(self.open_logs_dir) prefs_dir_action = self.help_menu.addAction('Open Prefs Dir') prefs_dir_action.triggered.connect(self.open_prefs_dir) config_dir_action = self.help_menu.addAction('Open Plugins Dir') @@ -1335,29 +1338,26 @@ def window_action_triggered(self, action=None): @staticmethod def open_prefs_dir(): - d = user_dir.PREF_DIR - if 'darwin' in sys.platform: - os.system('open {}'.format(d)) - elif 'win' in sys.platform: - os.startfile(d) - else: - try: - os.system('xdg-open {}'.format(d)) - except: - logger.exception('Failed to open user dir') + QtGui.QDesktopServices.openUrl( + QtCore.QUrl.fromLocalFile(user_dir.PREF_DIR) + ) @staticmethod def open_plugins_dir(): - d = USER_PLUGIN_DIR - if 'darwin' in sys.platform: - os.system('open {}'.format(d)) - elif 'win' in sys.platform: - os.startfile(d) - else: - try: - os.system('xdg-open {}'.format(d)) - except: - logger.exception('Failed to open user config dir') + QtGui.QDesktopServices.openUrl( + QtCore.QUrl.fromLocalFile(USER_PLUGIN_DIR) + ) + + @staticmethod + def open_logs_dir(): + try: + log_dir = nxt_log.LOG_DIR + except AttributeError: + # Guess the log dif if nxt core is old. + log_dir = os.path.join(tempfile.gettempdir(), 'nxt_logs') + QtGui.QDesktopServices.openUrl( + QtCore.QUrl.fromLocalFile(log_dir) + ) def about_message(self): text = ('nxt {} \n' From 23d15f60355d9392354716098df152bd76ffdbe6 Mon Sep 17 00:00:00 2001 From: Michael <11843596+MichaelAldrich@users.noreply.github.com> Date: Tue, 14 May 2024 16:48:32 -0400 Subject: [PATCH 2/9] * Fix QGraphicsScene::removeItem log spam --- nxt_editor/node_graphics_item.py | 3 ++- nxt_editor/stage_view.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nxt_editor/node_graphics_item.py b/nxt_editor/node_graphics_item.py index 1eea793..b8de726 100644 --- a/nxt_editor/node_graphics_item.py +++ b/nxt_editor/node_graphics_item.py @@ -452,7 +452,8 @@ def draw_title(self, painter, lod=1.): # draw collapse state arrow for arrow in self.collapse_arrows: - self.scene().removeItem(arrow) + if arrow.scene(): + self.scene().removeItem(arrow) if lod > MIN_LOD: self.collapse_arrows = [] # TODO calculation needed arrows should be done outside drawing diff --git a/nxt_editor/stage_view.py b/nxt_editor/stage_view.py index d9d0dbc..11151ec 100644 --- a/nxt_editor/stage_view.py +++ b/nxt_editor/stage_view.py @@ -1281,7 +1281,8 @@ def remove_node_graphic(self, node_path): self.remove_node_connection_graphics(node_path) def handle_del(): - self.scene().removeItem(graphic) + if graphic.scene(): + self.scene().removeItem(graphic) graphic.out_anim_group.finished.connect(handle_del) graphic.anim_out() From 28bce8de85046aa4f671c430273ecae530147cb3 Mon Sep 17 00:00:00 2001 From: Michael <11843596+MichaelAldrich@users.noreply.github.com> Date: Tue, 14 May 2024 15:49:15 -0400 Subject: [PATCH 3/9] * direct some traffic to use the stage model when needed. --- nxt_editor/dockwidgets/code_editor.py | 2 +- nxt_editor/dockwidgets/property_editor.py | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/nxt_editor/dockwidgets/code_editor.py b/nxt_editor/dockwidgets/code_editor.py index fea0f5a..0005dda 100644 --- a/nxt_editor/dockwidgets/code_editor.py +++ b/nxt_editor/dockwidgets/code_editor.py @@ -334,7 +334,7 @@ def update_editor(self, node_list=()): self.setEnabled(True) if self.editing_active: return - if not self.stage_model.comp_layer.node_exists(self.node_path): + if not self.stage_model.node_exists(self.node_path): self.editor.clear() return self.update_code_is_local() diff --git a/nxt_editor/dockwidgets/property_editor.py b/nxt_editor/dockwidgets/property_editor.py index 45f56d5..2f80f38 100644 --- a/nxt_editor/dockwidgets/property_editor.py +++ b/nxt_editor/dockwidgets/property_editor.py @@ -546,9 +546,9 @@ def set_represented_node(self): order = QtCore.Qt.DescendingOrder col = self.user_sort_pref['column'] if self.model.rowCount(self): - self.model.horizontal_header.blockSignals(True) - self.model.horizontal_header.setSortIndicator(col, order) - self.model.horizontal_header.blockSignals(False) + self.table_view.horizontalHeader().blockSignals(True) + self.table_view.horizontalHeader().setSortIndicator(col, order) + self.table_view.horizontalHeader().blockSignals(False) self.node_name = nxt_path.node_name_from_node_path(self.node_path) if not self.node_name: @@ -1553,10 +1553,7 @@ def paint(self, painter, option, index): inner_rect = inner_rect.marginsRemoved(QtCore.QMargins(1, 1, 1, 1)) painter.setPen(QtCore.Qt.NoPen) painter.setBrush(option.backgroundBrush) - attr_name = index.sibling(index.row(), COLUMNS.name).data() - model = index.model().sourceModel() - color = model.node_attr_draw_details[attr_name]['color'] - color = QtGui.QColor(color) + color = index.data(role=QtCore.Qt.ForegroundRole) painter.setPen(color) if option.state & QtWidgets.QStyle.State_MouseOver: if self.parent.mouse_pressed == index.column(): From 82ea3f946db96cf83596612aad84d8bb4e390362 Mon Sep 17 00:00:00 2001 From: Michael Aldrich <11843596+MichaelAldrich@users.noreply.github.com> Date: Fri, 17 May 2024 11:03:13 -0400 Subject: [PATCH 4/9] Update nxt_editor/main_window.py Co-authored-by: ImLucasBrown <54835354+ImLucasBrown@users.noreply.github.com> --- nxt_editor/main_window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxt_editor/main_window.py b/nxt_editor/main_window.py index 13cee1f..13971e0 100644 --- a/nxt_editor/main_window.py +++ b/nxt_editor/main_window.py @@ -1353,7 +1353,7 @@ def open_logs_dir(): try: log_dir = nxt_log.LOG_DIR except AttributeError: - # Guess the log dif if nxt core is old. + # Guess the log dir if nxt core is old. log_dir = os.path.join(tempfile.gettempdir(), 'nxt_logs') QtGui.QDesktopServices.openUrl( QtCore.QUrl.fromLocalFile(log_dir) From ab11116c7636d2bdbe0dee5ea833c766ce1cbda8 Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+imlucasbrown@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:00:57 -0500 Subject: [PATCH 5/9] ! Raised support for Qt.py to `<3` ! Dropped Py2 support --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2679ca3..7b98ff4 100644 --- a/setup.py +++ b/setup.py @@ -28,9 +28,9 @@ long_description_content_type="text/markdown", url="https://github.com/nxt-dev/nxt_editor", packages=setuptools.find_packages(), - python_requires='>=2.7, <3.11', + python_requires='>=3.7, <3.11', install_requires=['nxt-core<1.0,>=0.14', - 'qt.py==1.1', + 'qt.py<3', 'pyside2>=5.11,<=5.16' ], package_data={ From 5c2956a5cd36986c23bfa6b554a58ef9f615e983 Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+imlucasbrown@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:11:29 -0500 Subject: [PATCH 6/9] + Added deployment workflows - Removed Travis CI * Updated readme badges and formatting --- .github/workflows/release.yml | 14 ++++++++++++++ .github/workflows/unittests.yml | 17 +++++++++++++++++ .travis.yml | 30 ------------------------------ README.md | 5 +++++ 4 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/unittests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a0e69ef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,14 @@ +name: Release + +on: + push: + branches: [release] + workflow_dispatch: + branches: [release] + +jobs: + test-and-deploy: + secrets: inherit + uses: nxt-dev/nxt/.github/workflows/release.yml@release + with: + QT_DEPENDENCIES: true diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml new file mode 100644 index 0000000..ae7609e --- /dev/null +++ b/.github/workflows/unittests.yml @@ -0,0 +1,17 @@ +name: Unittests + +on: + workflow_dispatch: + branches-ignore: [release] + workflow_call: + pull_request: + branches-ignore: [release] + push: + branches-ignore: [release] + +jobs: + test-python: + secrets: inherit + uses: nxt-dev/nxt/.github/workflows/unittests.yml@dev + with: + QT_DEPENDENCIES: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2f1adc5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: python -branches: - only: - - release - - dev -python: - - "3.7" - -before_install: - - | - if [ "$TRAVIS_BRANCH" = "dev" ] && [ "$TRAVIS_EVENT_TYPE" = "push" ]; then - echo "Push to dev, not running until push to release" - exit 0 - else - echo "Doing the build" - fi - -install: - - cd .. - - git clone https://github.com/nxt-dev/nxt.git - - pip install importlib-metadata==3.4 - - pip install ./nxt_editor - -script: - - | - if [ "$TRAVIS_BRANCH" = "release" ] && [ "$TRAVIS_EVENT_TYPE" = "push" ]; then - pip install twine - python -m nxt.cli exec nxt_editor/build/packaging.nxt -s /make_and_upload - exit $? - fi \ No newline at end of file diff --git a/README.md b/README.md index 1718755..e3ad08a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ +
+ +![Release Status](https://github.com/nxt-dev/nxt_editor_test/actions/workflows/release.yml/badge.svg?branch=release) +![Dev Status](https://github.com/nxt-dev/nxt_editor_test/actions/workflows/unittests.yml/badge.svg?branch=dev) # NXT Editor +
**nxt** (**/ɛn·ɛks·ti/**) is a general purpose code compositor designed for rigging, scene assembly, and automation. (node execution tree) [Installation/Usage](#installationusage) | [Docs](https://nxt-dev.github.io/) | [Contributing](CONTRIBUTING.md) | [Licensing](LICENSE) From 6c3598b79381f4d6b19392e54ca8bb8328fc35ed Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+ImLucasBrown@users.noreply.github.com> Date: Sun, 9 Jun 2024 12:49:08 -0500 Subject: [PATCH 7/9] Corrected badge links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e3ad08a..09c3203 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
-![Release Status](https://github.com/nxt-dev/nxt_editor_test/actions/workflows/release.yml/badge.svg?branch=release) -![Dev Status](https://github.com/nxt-dev/nxt_editor_test/actions/workflows/unittests.yml/badge.svg?branch=dev) +![Release Status](https://github.com/nxt-dev/nxt_editor/actions/workflows/release.yml/badge.svg?branch=release) +![Dev Status](https://github.com/nxt-dev/nxt_editor/actions/workflows/unittests.yml/badge.svg?branch=dev) # NXT Editor
From 6fb76c280a9fda5ab4a46b8debbc72e44201c1c9 Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+ImLucasBrown@users.noreply.github.com> Date: Sun, 9 Jun 2024 12:49:46 -0500 Subject: [PATCH 8/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 09c3203..a251c64 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ # NXT Editor + + **nxt** (**/ɛn·ɛks·ti/**) is a general purpose code compositor designed for rigging, scene assembly, and automation. (node execution tree) [Installation/Usage](#installationusage) | [Docs](https://nxt-dev.github.io/) | [Contributing](CONTRIBUTING.md) | [Licensing](LICENSE) From 4d2be986efea445a0d3d06a3b3a73418a51dd39f Mon Sep 17 00:00:00 2001 From: Lucas Brown <54835354+imlucasbrown@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:43:20 -0500 Subject: [PATCH 9/9] version up for release --- nxt_editor/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxt_editor/version.json b/nxt_editor/version.json index d76d81b..1b7135a 100644 --- a/nxt_editor/version.json +++ b/nxt_editor/version.json @@ -1,7 +1,7 @@ { "EDITOR": { "MAJOR": 3, - "MINOR": 15, + "MINOR": 16, "PATCH": 0 } }