mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-28 00:16:32 +02:00
[ui] Add a "Clear All Images" action and update "Clear Images"'s behaviour
"Clear Images" used to clear the intrinsics and viewpoints for all the existing CameraInit nodes in the graph. There was no-user friendly way to clear the images of a specific CameraInit node. This commit modifies the behaviour of "Clear Images" so that it only deletes the intrinsics and viewpoints of the current CameraInit. A new menu action, "Clear All Images", is added in the "Advanced" sub-menu, and deletes all the intrinsics and viewpoints for all the CameraInit nodes. The way images are cleared is also modified: instead of removing the intrinsics and viewpoints attributes, they are reset. To be undone properly, a corresponding "ClearImagesCommand" has been added. This offers a great performance increase (clearing 1000 images now takes 1s). Tooltips have been added to make the distinction clearer for users.
This commit is contained in:
parent
2987bf0617
commit
43f439be88
4 changed files with 66 additions and 26 deletions
|
@ -733,6 +733,16 @@ class UIGraph(QObject):
|
|||
def removeAttribute(self, attribute):
|
||||
self.push(commands.ListAttributeRemoveCommand(self._graph, attribute))
|
||||
|
||||
@Slot()
|
||||
def clearImages(self):
|
||||
with self.groupedGraphModification("Clear Images"):
|
||||
self.push(commands.ClearImagesCommand(self._graph, [self.cameraInit]))
|
||||
|
||||
@Slot()
|
||||
def clearAllImages(self):
|
||||
with self.groupedGraphModification("Clear All Images"):
|
||||
self.push(commands.ClearImagesCommand(self._graph, list(self.cameraInits)))
|
||||
|
||||
@Slot(Node)
|
||||
def appendSelection(self, node):
|
||||
""" Append 'node' to the selection if it is not already part of the selection. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue