mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-07 21:31:56 +02:00
enable sequence player by default
This commit is contained in:
parent
eef1e6414e
commit
457b640002
2 changed files with 32 additions and 11 deletions
|
@ -587,7 +587,7 @@ class MeshroomApp(QApplication):
|
||||||
return bool(os.environ.get("MESHROOM_USE_8BIT_VIEWER", False))
|
return bool(os.environ.get("MESHROOM_USE_8BIT_VIEWER", False))
|
||||||
|
|
||||||
def _defaultSequencePlayerEnabled(self):
|
def _defaultSequencePlayerEnabled(self):
|
||||||
return bool(os.environ.get("MESHROOM_USE_SEQUENCE_PLAYER", False))
|
return bool(os.environ.get("MESHROOM_USE_SEQUENCE_PLAYER", True))
|
||||||
|
|
||||||
activeProjectChanged = Signal()
|
activeProjectChanged = Signal()
|
||||||
activeProject = Property(Variant, lambda self: self._activeProject, notify=activeProjectChanged)
|
activeProject = Property(Variant, lambda self: self._activeProject, notify=activeProjectChanged)
|
||||||
|
|
|
@ -36,6 +36,10 @@ FocusScope {
|
||||||
property alias currentFrame: sequencePlayer.frameId
|
property alias currentFrame: sequencePlayer.frameId
|
||||||
property alias frameRange: sequencePlayer.frameRange
|
property alias frameRange: sequencePlayer.frameRange
|
||||||
|
|
||||||
|
property bool fittedOnce: false
|
||||||
|
property int previousWidth: -1
|
||||||
|
property int previousHeight: -1
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: m
|
id: m
|
||||||
property variant viewpointMetadata: {
|
property variant viewpointMetadata: {
|
||||||
|
@ -472,12 +476,13 @@ FocusScope {
|
||||||
orientationTag: imgContainer.orientationTag
|
orientationTag: imgContainer.orientationTag
|
||||||
xOrigin: imgContainer.width / 2
|
xOrigin: imgContainer.width / 2
|
||||||
yOrigin: imgContainer.height / 2
|
yOrigin: imgContainer.height / 2
|
||||||
property bool fittedOnce: false
|
|
||||||
property int previousWidth: 0
|
|
||||||
property int previousHeight: 0
|
|
||||||
property real targetSize: Math.max(width, height) * imgContainer.scale
|
property real targetSize: Math.max(width, height) * imgContainer.scale
|
||||||
property real resizeRatio: imgContainer.scale
|
property real resizeRatio: imgContainer.scale
|
||||||
onHeightChanged: {
|
|
||||||
|
|
||||||
|
|
||||||
|
function sizeChanged() {
|
||||||
/* Image size is not updated through a single signal with the floatImage viewer, unlike
|
/* Image size is not updated through a single signal with the floatImage viewer, unlike
|
||||||
* the simple QML image viewer: instead of updating straight away the width and height to x and
|
* the simple QML image viewer: instead of updating straight away the width and height to x and
|
||||||
* y, the emitted signals look like:
|
* y, the emitted signals look like:
|
||||||
|
@ -489,13 +494,29 @@ FocusScope {
|
||||||
* group has already been auto-fitted. If we change the group of images (when another project is
|
* group has already been auto-fitted. If we change the group of images (when another project is
|
||||||
* opened, for example, and the images have a different size), then another auto-fit needs to be
|
* opened, for example, and the images have a different size), then another auto-fit needs to be
|
||||||
* performed */
|
* performed */
|
||||||
if ((!fittedOnce && imgContainer.image && imgContainer.image.height > 0) ||
|
|
||||||
(fittedOnce && ((width > 1 && previousWidth != width) ||
|
var sizeValid = (width > 0) && (height > 0)
|
||||||
(height > 1 && previousHeight != height)))) {
|
var layoutValid = (root.width > 50) && (root.height > 50)
|
||||||
|
var sizeChanged = (root.previousWidth != width) || (root.previousHeight != height)
|
||||||
|
var sizeChanged = (root.previousWidth != width) || (root.previousHeight != height)
|
||||||
|
|
||||||
|
if ((!root.fittedOnce && imgContainer.image && sizeValid && layoutValid) ||
|
||||||
|
(root.fittedOnce && sizeChanged && sizeValid && layoutValid)) {
|
||||||
fit()
|
fit()
|
||||||
fittedOnce = true
|
root.fittedOnce = true
|
||||||
previousWidth = width
|
root.previousWidth = width
|
||||||
previousHeight = height
|
root.previousHeight = height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onHeightChanged : {
|
||||||
|
floatImageViewerLoader.sizeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
function onHeightChanged() {
|
||||||
|
floatImageViewerLoader.sizeChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue