From b3aef333adbbd4b29f5eaa4b73c39cafcfd98ea4 Mon Sep 17 00:00:00 2001 From: Matthieu Hog Date: Tue, 24 Sep 2024 17:27:58 +0200 Subject: [PATCH] changes for uid renaming added back menu after update fix for existing symlink --- meshroom/core/plugin.py | 10 ++++++--- meshroom/ui/qml/Application.qml | 31 +++++++++++++++++++--------- meshroom/ui/qml/GraphEditor/Node.qml | 1 - 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/meshroom/core/plugin.py b/meshroom/core/plugin.py index d54e97f0ed..2ef50f252d 100644 --- a/meshroom/core/plugin.py +++ b/meshroom/core/plugin.py @@ -170,7 +170,11 @@ def installPlugin(pluginUrl): if isLocal: os.symlink(pluginParam.nodesFolder, intallFolder) if os.path.isdir(pluginParam.pipelineFolder): - os.symlink(pluginParam.pipelineFolder, os.path.join(pluginsPipelinesFolder, pluginParam.pluginName)) + pipelineFolderLink = os.path.join(pluginsPipelinesFolder, pluginParam.pluginName) + if os.path.exists(pipelineFolderLink): + logging.warn("Plugin already installed, will overwrite") + os.unlink(pipelineFolderLink) + os.symlink(pluginParam.pipelineFolder, pipelineFolderLink) else: copy_tree(pluginParam.nodesFolder, intallFolder) if os.path.isdir(pluginParam.pipelineFolder): @@ -298,7 +302,7 @@ def getCommandLine(chunk): raise RuntimeError("The project needs to be saved to use plugin nodes") saved_graph = loadGraph(chunk.node.graph.filepath) if (str(chunk.node) not in [str(f) for f in saved_graph._nodes._objects] - or chunk.node._uids[0] != saved_graph.findNode(str(chunk.node))._uids[0] ): + or chunk.node._uid != saved_graph.findNode(str(chunk.node))._uid ): raise RuntimeError("The changes needs to be saved to use plugin nodes") cmdPrefix = "" @@ -342,7 +346,7 @@ def getCommandLine(chunk): return command -# you may use these to esplicitly define Pluginnodes +# you may use these to explicitly define Pluginnodes class PluginNode(desc.Node): pass diff --git a/meshroom/ui/qml/Application.qml b/meshroom/ui/qml/Application.qml index 345eb62b9e..00dc59b6a3 100644 --- a/meshroom/ui/qml/Application.qml +++ b/meshroom/ui/qml/Application.qml @@ -825,6 +825,18 @@ Page { ToolTip.visible: hovered ToolTip.text: removeImagesFromAllGroupsAction.tooltip } + + MenuItem { + action: installPluginFromFolderAction + ToolTip.visible: hovered + ToolTip.text: "Install plugin from a folder" + } + + MenuItem { + action: installPluginFromURLAction + ToolTip.visible: hovered + ToolTip.text: "Install plugin from a local or online url" + } } MenuSeparator { } Action { @@ -1298,18 +1310,17 @@ Page { var n = _reconstruction.upgradeNode(node) _reconstruction.selectedNode = n } - } - onDoBuild: { - try { - _reconstruction.buildNode(node.name) - node.isNotBuilt=false - } catch (error) { - //NOTE: could do an error popup - console.log("Build error:") - console.log(error) + onDoBuild: { + try { + _reconstruction.buildNode(node.name) + node.isNotBuilt=false + } catch (error) { + //NOTE: could do an error popup + console.log("Build error:") + console.log(error) + } } - } } } diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 4de416c420..6c1eb385c9 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -31,7 +31,6 @@ Item { property point position: Qt.point(x, y) /// Styling property color shadowColor: "#cc000000" - //readonly property color defaultColor: isCompatibilityNode ? "#444" : ((isPlugin && isNotBuilt) ? "#444": (!node.isComputable ? "#BA3D69" : activePalette.base)) readonly property color defaultColor: isCompatibilityNode ? "#444" : (!node.isComputable ? "#BA3D69" : activePalette.base) property color baseColor: defaultColor