Skip to content

Commit dbcc0df

Browse files
author
Fabien Servant
committed
enable sequence player by default
1 parent 256fdc1 commit dbcc0df

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

meshroom/ui/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def _default8bitViewerEnabled(self):
587587
return bool(os.environ.get("MESHROOM_USE_8BIT_VIEWER", False))
588588

589589
def _defaultSequencePlayerEnabled(self):
590-
return bool(os.environ.get("MESHROOM_USE_SEQUENCE_PLAYER", False))
590+
return bool(os.environ.get("MESHROOM_USE_SEQUENCE_PLAYER", True))
591591

592592
activeProjectChanged = Signal()
593593
activeProject = Property(Variant, lambda self: self._activeProject, notify=activeProjectChanged)

meshroom/ui/qml/Viewer/Viewer2D.qml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ FocusScope {
3636
property alias currentFrame: sequencePlayer.frameId
3737
property alias frameRange: sequencePlayer.frameRange
3838

39+
property bool fittedOnce: false
40+
property int previousWidth: -1
41+
property int previousHeight: -1
42+
3943
QtObject {
4044
id: m
4145
property variant viewpointMetadata: {
@@ -472,12 +476,14 @@ FocusScope {
472476
orientationTag: imgContainer.orientationTag
473477
xOrigin: imgContainer.width / 2
474478
yOrigin: imgContainer.height / 2
475-
property bool fittedOnce: false
476-
property int previousWidth: 0
477-
property int previousHeight: 0
479+
478480
property real targetSize: Math.max(width, height) * imgContainer.scale
479481
property real resizeRatio: imgContainer.scale
480-
onHeightChanged: {
482+
483+
484+
485+
function sizeChanged() {
486+
print("func")
481487
/* Image size is not updated through a single signal with the floatImage viewer, unlike
482488
* the simple QML image viewer: instead of updating straight away the width and height to x and
483489
* y, the emitted signals look like:
@@ -489,13 +495,29 @@ FocusScope {
489495
* group has already been auto-fitted. If we change the group of images (when another project is
490496
* opened, for example, and the images have a different size), then another auto-fit needs to be
491497
* performed */
492-
if ((!fittedOnce && imgContainer.image && imgContainer.image.height > 0) ||
493-
(fittedOnce && ((width > 1 && previousWidth != width) ||
494-
(height > 1 && previousHeight != height)))) {
498+
499+
var sizeValid = (width > 0) && (height > 0)
500+
var layoutValid = (root.width > 50) && (root.height > 50)
501+
var sizeChanged = (root.previousWidth != width) || (root.previousHeight != height)
502+
var sizeChanged = (root.previousWidth != width) || (root.previousHeight != height)
503+
504+
if ((!root.fittedOnce && imgContainer.image && sizeValid && layoutValid) ||
505+
(root.fittedOnce && sizeChanged && sizeValid && layoutValid)) {
495506
fit()
496-
fittedOnce = true
497-
previousWidth = width
498-
previousHeight = height
507+
root.fittedOnce = true
508+
root.previousWidth = width
509+
root.previousHeight = height
510+
}
511+
}
512+
513+
onHeightChanged : {
514+
floatImageViewerLoader.sizeChanged();
515+
}
516+
517+
Connections {
518+
target: root
519+
function onHeightChanged() {
520+
floatImageViewerLoader.sizeChanged()
499521
}
500522
}
501523

0 commit comments

Comments
 (0)