Skip to content

Commit 68e1ba3

Browse files
committed
[ui] Graph: Using Grouped UI Graph Modification to disable animation for qml elements
Used graph's disabledAnimation flag to halt the animations when a backdrop node is resized during an undo.
1 parent 54a569a commit 68e1ba3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

meshroom/ui/graph.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,18 @@ def groupedGraphModification(self, title, disableUpdates=True):
634634
"""
635635
return commands.GroupedGraphModification(self._graph, self._undoStack, title, disableUpdates)
636636

637+
def groupedUIGraphModification(self, title, disableUpdates=True):
638+
""" Get a GroupedUIGraphModification for this Graph.
639+
640+
Args:
641+
title (str): the title of the macro command
642+
disableUpdates (bool): whether to disable graph and ui updates
643+
644+
Returns:
645+
GroupedGraphModification: the instantiated context manager
646+
"""
647+
return commands.GroupedUIGraphModification(self, self._undoStack, title, disableUpdates)
648+
637649
@Slot(str)
638650
def beginModification(self, name):
639651
""" Begin a Graph modification. Calls to beginModification and endModification may be nested, but
@@ -698,7 +710,7 @@ def resizeAndMoveNode(self, node, width, height, position=None):
698710
position (QPoint): Node's position.
699711
"""
700712
# Update the node size
701-
with self.groupedGraphModification("Resize Node"):
713+
with self.groupedUIGraphModification("Resize Node"):
702714
if node.hasInternalAttribute("nodeWidth"):
703715
self.setAttribute(node.internalAttribute("nodeWidth"), width)
704716
if node.hasInternalAttribute("nodeHeight"):

meshroom/ui/qml/GraphEditor/GraphEditor.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ Item {
11291129
}
11301130

11311131
Behavior on x {
1132-
enabled: !nodeRepeater.ongoingDrag && !resizing
1132+
enabled: !nodeRepeater.ongoingDrag && !resizing && !uigraph.animationsDisabled;
11331133
NumberAnimation { duration: 100 }
11341134
}
11351135
Behavior on y {

0 commit comments

Comments
 (0)