From d7e9aac032d2704add993950d418b807e3049160 Mon Sep 17 00:00:00 2001 From: MichaelAldrich <11843596+MichaelAldrich@users.noreply.github.com> Date: Mon, 1 Mar 2021 21:32:23 -0500 Subject: [PATCH 1/5] * Do not start rpc server in unreal * Fail safely when unreal is loaded headlessly. --- nxt_editor/integration/unreal/Content/Python/init_unreal.py | 6 +++++- nxt_editor/integration/unreal/__init__.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nxt_editor/integration/unreal/Content/Python/init_unreal.py b/nxt_editor/integration/unreal/Content/Python/init_unreal.py index 95e915f..78e6130 100644 --- a/nxt_editor/integration/unreal/Content/Python/init_unreal.py +++ b/nxt_editor/integration/unreal/Content/Python/init_unreal.py @@ -80,7 +80,11 @@ def make_or_find_nxt_menu(): return nxt_menu def refresh_nxt_menu(): - nxt_menu = make_or_find_nxt_menu() + try: + nxt_menu = make_or_find_nxt_menu() + except ValueError: + # If the plugin is loaded in unreal headless, the menu won't exist. + return if is_nxt_available(): nxt_menu.add_menu_entry("nxt-section", make_open_editor_entry()) nxt_menu.add_menu_entry("nxt-section", make_update_entry()) diff --git a/nxt_editor/integration/unreal/__init__.py b/nxt_editor/integration/unreal/__init__.py index 063c64b..8f972f8 100644 --- a/nxt_editor/integration/unreal/__init__.py +++ b/nxt_editor/integration/unreal/__init__.py @@ -28,7 +28,7 @@ def launch_nxt_in_ue(): __NXT_WINDOW.show() __NXT_WINDOW.raise_() else: - __NXT_WINDOW = nxt_editor.show_new_editor() + __NXT_WINDOW = nxt_editor.show_new_editor(start_rpc=False) __NXT_WINDOW.close_signal.connect(existing.exit) atexit.register(__NXT_WINDOW.close) \ No newline at end of file From 820d8d808d5cfd0fffc3c51839d442694d147a81 Mon Sep 17 00:00:00 2001 From: Michael Aldrich <11843596+MichaelAldrich@users.noreply.github.com> Date: Tue, 9 Mar 2021 11:35:09 -0600 Subject: [PATCH 2/5] Remove false fix in unreal editor launch --- nxt_editor/integration/unreal/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nxt_editor/integration/unreal/__init__.py b/nxt_editor/integration/unreal/__init__.py index 8f972f8..d1c132f 100644 --- a/nxt_editor/integration/unreal/__init__.py +++ b/nxt_editor/integration/unreal/__init__.py @@ -28,7 +28,7 @@ def launch_nxt_in_ue(): __NXT_WINDOW.show() __NXT_WINDOW.raise_() else: - __NXT_WINDOW = nxt_editor.show_new_editor(start_rpc=False) + __NXT_WINDOW = nxt_editor.show_new_editor() __NXT_WINDOW.close_signal.connect(existing.exit) - atexit.register(__NXT_WINDOW.close) \ No newline at end of file + atexit.register(__NXT_WINDOW.close) From ee2b5dad57bc019728e47f368368a6d49d1584b3 Mon Sep 17 00:00:00 2001 From: ImLucasBrown <54835354+ImLucasBrown@users.noreply.github.com> Date: Mon, 29 Mar 2021 08:59:42 -0400 Subject: [PATCH 3/5] * Bug fix: Corrupted editor cache could crash the editor when selecting a node. --- nxt_editor/dockwidgets/property_editor.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nxt_editor/dockwidgets/property_editor.py b/nxt_editor/dockwidgets/property_editor.py index 29e01a9..7280199 100644 --- a/nxt_editor/dockwidgets/property_editor.py +++ b/nxt_editor/dockwidgets/property_editor.py @@ -1,6 +1,7 @@ # Built-in import textwrap import sys +import logging from functools import partial # External @@ -18,7 +19,7 @@ from nxt_editor.dockwidgets.dock_widget_base import DockWidgetBase from nxt_editor.pixmap_button import PixmapButton from nxt_editor.label_edit import LabelEdit -from nxt_editor import colors +from nxt_editor import colors, LOGGER_NAME from nxt_editor.decorator_widgets import OpinionDots from nxt import DATA_STATE, NODE_ERRORS, nxt_path from nxt.nxt_node import INTERNAL_ATTRS, META_ATTRS @@ -27,6 +28,8 @@ # Fixme: Should this be a pref? HISTORICAL_MAX_CHARS = 50 +logger = logging.getLogger(LOGGER_NAME) + class PropertyEditor(DockWidgetBase): @@ -1250,7 +1253,11 @@ def set_represented_node(self, node_path=None): if self.state: if sys.version_info[0] > 2 and isinstance(self.state, str): self.state = bytes(self.state, 'utf-8') - self.horizontal_header.restoreState(self.state) + try: + self.horizontal_header.restoreState(self.state) + except TypeError: + logger.error('Corrupted property editor pref!') + self.state = '' self.view.resizeColumnToContents(COLUMNS.nxt_type) def get_data(self): From 2ebcea49eadf9185895c47f2acc8dce12c16e978 Mon Sep 17 00:00:00 2001 From: ImLucasBrown <54835354+ImLucasBrown@users.noreply.github.com> Date: Mon, 29 Mar 2021 12:01:34 -0400 Subject: [PATCH 4/5] * Bug fix: Connection graphic lines wouldn't go away after collapsing some nodes. --- nxt_editor/connection_graphics_item.py | 3 +-- nxt_editor/stage_view.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nxt_editor/connection_graphics_item.py b/nxt_editor/connection_graphics_item.py index 33ff732..897b6c6 100644 --- a/nxt_editor/connection_graphics_item.py +++ b/nxt_editor/connection_graphics_item.py @@ -111,8 +111,7 @@ def paint(self, painter, option, widget): QtGui.QPainter.SmoothPixmapTransform, False) thick_mult = 3 pen_style = QtCore.Qt.PenStyle.SolidLine - pen = QtGui.QPen(self.color, self.thickness * thick_mult, - self.pen_style) + pen = QtGui.QPen(self.color, self.thickness * thick_mult, pen_style) # if self.tgt_path in self.model.selection: # pen.setColor(colors.SELECTED) # elif self.is_hovered: diff --git a/nxt_editor/stage_view.py b/nxt_editor/stage_view.py index b0e438b..981a45d 100644 --- a/nxt_editor/stage_view.py +++ b/nxt_editor/stage_view.py @@ -1258,11 +1258,11 @@ def handle_collapse_changed(self, node_paths): graphic.update_collapse() collapsed = self.model.get_node_collapse(path, comp_layer) if collapsed: - children = self.model.get_children(path, - include_implied=True) - for child_path in children: + descendants = self.model.get_descendants(path, + include_implied=True) + for child_path in descendants: self.remove_node_graphic(child_path) - if children: + if descendants: roots_hit.add(nxt_path.get_root_path(path)) else: descendants = self.model.get_descendants(path, From 02277cad51d9b7c538ee16e308fb5d8841a23816 Mon Sep 17 00:00:00 2001 From: Michael Aldrich <11843596+MichaelAldrich@users.noreply.github.com> Date: Fri, 30 Apr 2021 20:53:15 -0400 Subject: [PATCH 5/5] Update version 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 eebe181..ae7dda7 100644 --- a/nxt_editor/version.json +++ b/nxt_editor/version.json @@ -2,6 +2,6 @@ "EDITOR": { "MAJOR": 3, "MINOR": 8, - "PATCH": 1 + "PATCH": 2 } }