[ui] Add a "Reload All Nodes" menu to reload all the plugins' nodes

"Reload All Nodes" will reload all the descriptions for `NodePlugins`
that are part of loaded plugins, whether they are registered or not.

Once the reload of the descriptions has been performed, the node instances
from the current graph will be reloaded as well to reflect any change
in the description.
This commit is contained in:
Candice Bentéjac 2025-06-05 16:09:56 +02:00
parent 3d36ea5f2a
commit 0c5e76997a
2 changed files with 28 additions and 0 deletions

View file

@ -552,6 +552,15 @@ Page {
}
}
Action {
id: reloadAllNodesAction
property string tooltip: "Reload all the node descriptions for all the registered plugins"
text: "Reload All Nodes"
onTriggered: {
_reconstruction.reloadAllNodes()
}
}
Action {
id: undoAction
@ -830,6 +839,12 @@ Page {
ToolTip.visible: hovered
ToolTip.text: removeImagesFromAllGroupsAction.tooltip
}
MenuItem {
action: reloadAllNodesAction
ToolTip.visible: hovered
ToolTip.text: reloadAllNodesAction.tooltip
}
}
MenuSeparator { }
Action {

View file

@ -552,6 +552,19 @@ class Reconstruction(UIGraph):
nodes = self._graph.dfsOnDiscover(startNodes=[self._cameraInit], reverse=True)[0]
self.setActiveNodes(nodes)
@Slot()
def reloadAllNodes(self):
"""
Reload all the NodePlugins from all the registered plugins.
The nodes in the graph will be updated to match the changes in the description, if
there was any.
"""
for plugin in meshroom.core.pluginManager.getPlugins().values():
for node in plugin.nodes.values():
node.reload()
self._graph.reloadAllNodes()
@Slot()
@Slot(str)
def new(self, pipeline=None):