Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f07c924
[requirements] Update requirement for PySide to PySide 6.6.3.1
cbentejac Oct 1, 2024
579371f
[qt6] Replace all `PySide2/shiboken2` imports by `PySide6/shiboken6`
cbentejac Oct 1, 2024
96a70c0
[qt6] Remove imports of QML modules that do not exist anymore with Qt6.6
cbentejac Oct 1, 2024
02be73d
[qt6] Remove properties that do not exist anymore in Qt6.6
cbentejac Oct 1, 2024
9923980
[qt6] Use exec() instead of deprecated exec_() in __main__.py
cbentejac Oct 1, 2024
d5cfdb1
[qt6] Re-enable alternative base and keyboard shortcut to switch to it
cbentejac Oct 1, 2024
1b9e75c
[qt6] Replace Qt.labs.settings with QtCore.Settings
cbentejac Oct 1, 2024
6d84537
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
0e71f2a
[qt6] Update versions for all the imported modules
cbentejac Oct 1, 2024
b9ec8fe
[qt6][GraphEditor] Rename identifiers for attribute items
cbentejac Oct 1, 2024
a62bed0
[qt6][GraphEditor] Fix `ColorDialog` selection
cbentejac Oct 1, 2024
595e8f6
[qt6][qml] Do not explicitly set a Palette value with a QPalette
cbentejac Oct 1, 2024
d5b5163
[qt6] Remove shaders from Meshroom and move them to QtAliceVision
cbentejac Oct 1, 2024
b65197e
[qt6] Set the RHI backend to "opengl"
cbentejac Oct 1, 2024
138cc18
[qt6][Materials] Use correct graphics API and update SH shaders
cbentejac Oct 1, 2024
2a78444
[qt6][components] Update Scene3DHelper and TrackballController
cbentejac Oct 1, 2024
e1ef8ac
[qt6][Viewer3D] MediaLibrary: Fix loading medias from attributes
cbentejac Oct 1, 2024
60eaced
[qt6] Update setup script with the correct version of PySide
cbentejac Oct 1, 2024
3ff279d
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
570d88e
[qt6] Stop enabling HighDpiScaling which is now deprecated
cbentejac Oct 1, 2024
f6a9e5d
[qt6][Viewer3D] Remove `PointSize` render state
cbentejac Oct 1, 2024
2b569c1
[qt6][Viewer3D] Inspector3D: Set color for labels in Inspector
cbentejac Oct 1, 2024
05e7d9e
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
77bd2a7
[qt6][Viewer] Viewer2D: Trigger auto-fit() on correct events
cbentejac Oct 1, 2024
240188c
[qt6][Viewer3D] Disable wireframe mode
cbentejac Oct 1, 2024
92e5667
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
fb5a882
[qt6][core] Don't store `SignalInstance` in dict for node computations
cbentejac Oct 1, 2024
9867773
[qt6][GraphEditor] Check for object's existence before accessing it
cbentejac Oct 1, 2024
66c3963
[qt6][Viewer3D] Use `DiffuseMapMaterial` for texture display
cbentejac Oct 1, 2024
fbe72a0
[qt6][GraphEditor] Correctly detect clicks on edges
cbentejac Oct 1, 2024
8007bc5
[qt6][GraphEditor] Set preferred size for the list of chunks
cbentejac Oct 1, 2024
9fb8ea8
[qt6][Viewer] Fix display of metadata
cbentejac Oct 1, 2024
f06c5a2
[qt6][MaterialIcons] Fix disabled buttons' behaviour when interacted …
cbentejac Oct 1, 2024
645b822
[qt6][GraphEditor] Fix the width for the TaskManager's list
cbentejac Oct 1, 2024
e97575a
[qt6][qml] Remove `QtQuick.Window` imports
cbentejac Oct 1, 2024
ec139de
[qt6][ImageGallery] IntrinsicDisplay: Harmonize naming of components
cbentejac Oct 1, 2024
de966e3
[qt6][ui] AboutDialog: Display PySide's version
cbentejac Oct 2, 2024
54b59d0
[qt6][qml] Push `Application` on the stack before loading the project
cbentejac Oct 2, 2024
8eebe5e
[qt6][qml] Homepage: Improve minimum width
cbentejac Oct 2, 2024
49a3fcb
[qt6][Viewer] Viewer2D: Remove outdated `sfmRequired` property
cbentejac Oct 3, 2024
4933911
[components] Edge: Remove use of deprecated functions
cbentejac Oct 8, 2024
52444ef
[GraphEditor] Edge: Set curve scale after initializing `EdgeMouseArea`
cbentejac Oct 8, 2024
0395047
[qt6][GraphEditor] Fix connections to `ListAttribute` pins
cbentejac Oct 10, 2024
c5be7e7
[qt6][Charts] InteractiveChartView: Remove dead code and useless imports
cbentejac Oct 10, 2024
b12d1fe
[qt6][qml] Remove unnecessary module imports
cbentejac Oct 11, 2024
5a0b1c0
[qt6][qml] Clean-up code and harmonize comments
cbentejac Oct 10, 2024
5953ed5
[qt6] Add QT6 support for wireframe on nvidia
cbentejac Oct 11, 2024
b884fc4
[qt6] Viewer3D: Reset the default render mode to "Textured"
cbentejac Oct 11, 2024
62f0a3e
[qt6][Viewer3D] Change picking behavior
cbentejac Oct 11, 2024
d4eb365
[qt6][Viewer] Fix zoom in 8bits viewer
Oct 9, 2024
36f7f4e
[qt6][Viewer] Viewer2D: Fix automatic fitting for missing orientation…
cbentejac Oct 17, 2024
a612319
[qt6][GraphEditor] Node: Ensure `readOnly` is set with a boolean
cbentejac Oct 17, 2024
2699bff
[qt6][ImageGallery] IntrinsicDisplayDelegate: Support `File` attributes
cbentejac Oct 17, 2024
65a014d
[qt6][Viewer] Viewer2D: Fix `fit()` with the Sequence Player
cbentejac Nov 13, 2024
69ea5b8
[qt6][Viewer3D] Fix mouse camera controller
Oct 9, 2024
9b48531
[ui] Controls: Add `DirectionalLightPane` component
gregoire-dl Jun 14, 2024
765a1f9
[ui] Viewer: Add `PhongImageViewerToolbar` component
gregoire-dl Jun 14, 2024
b6b9d1b
[ui] Viewer: Add `PhongImageViewer` component
gregoire-dl Jun 14, 2024
39b7dfd
[ui] Viewer: Add `PhongImageViewer` and toolbars to `Viewer2D`
gregoire-dl Jun 14, 2024
9df260a
[ui] scene3D: Add `getRotatedCameraViewVector` function
gregoire-dl Jun 14, 2024
bfda6f6
[ui] Viewer3D: Use directional light & add light controller
gregoire-dl Jun 14, 2024
5fca8a7
[ui] Viewer3D: Fix wrong camera up vector initialization
gregoire-dl Jun 14, 2024
d63f7f2
[qt6] `.git-blame-ignore-revs`: Add clean-up commits
cbentejac Nov 15, 2024
9af6ade
[qt6][ui] Limit useless calls to `recentProjectFiles` when opening di…
cbentejac Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [qt6][qml] Clean-up code and harmonize comments
5a0b1c0c9547b0d00f3f10fae6994d6d8ea0b45e
# [nodes] Linting: Clean-up files
4c0409f573c2694325b104c2686a1532f95cb9bc
# Linting: Clean-up files
Expand Down
2 changes: 1 addition & 1 deletion COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Meshroom is licensed under the [MPL2 license](LICENSE-MPL2.md).
Copyright (c) 2001-2018 Python Software Foundation.
Distributed under the [PSFL V2 license](https://www.python.org/download/releases/2.7/license/).

* __Qt/PySide2__
* __Qt/PySide6__
[https://www.qt.io](https://www.qt.io)
Copyright (C) 2018 The Qt Company Ltd and other contributors.
Distributed under the [LGPL V3 license](https://opensource.org/licenses/LGPL-3.0).
Expand Down
1 change: 1 addition & 0 deletions meshroom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,4 @@ def addToEnvPath(var, val, index=-1):
os.environ["QML_XHR_ALLOW_FILE_READ"] = '1'
os.environ["QML_XHR_ALLOW_FILE_WRITE"] = '1'
os.environ["PYSEQ_STRICT_PAD"] = '1'
os.environ["QSG_RHI_BACKEND"] = "opengl"
6 changes: 3 additions & 3 deletions meshroom/common/qt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide2 import QtCore, QtQml
import shiboken2
from PySide6 import QtCore, QtQml
import shiboken6


class QObjectListModel(QtCore.QAbstractListModel):
Expand Down Expand Up @@ -285,7 +285,7 @@ def _referenceItem(self, item):

def _dereferenceItem(self, item):
# Ask for object deletion if parented to the model
if shiboken2.isValid(item) and item.parent() == self:
if shiboken6.isValid(item) and item.parent() == self:
# delay deletion until the next event loop
# This avoids warnings when the QML engine tries to evaluate (but should not)
# an object that has already been deleted
Expand Down
5 changes: 4 additions & 1 deletion meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ def elapsedTimeStr(self):

def toDict(self):
d = self.__dict__.copy()
d.pop('destroyed', None) # skip non data attributes from BaseObject
d["elapsedTimeStr"] = self.elapsedTimeStr

# Skip non data attributes from BaseObject
d.pop("destroyed", None)
d.pop("objectNameChanged", None)
return d

def fromDict(self, d):
Expand Down
2 changes: 1 addition & 1 deletion meshroom/submitters/simpleFarmSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, parent=None):
# logging.info('REZ: {}'.format(str(r)))
v = r.split('-')
# logging.info(' v: {}'.format(str(v)))
if len(v) == 2:
if len(v) >= 2:
resolvedVersions[v[0]] = v[1]
for p in packages:
if p.startswith('~'):
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
import meshroom.ui.app

meshroom.ui.uiInstance = meshroom.ui.app.MeshroomApp(sys.argv)
meshroom.ui.uiInstance.exec_()
meshroom.ui.uiInstance.exec()
18 changes: 10 additions & 8 deletions meshroom/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import argparse
import json

from PySide2 import QtCore
from PySide2.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QApplication
from PySide6 import __version__ as PySideVersion
from PySide6 import QtCore
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication

import meshroom
from meshroom.core import nodesDesc
Expand Down Expand Up @@ -188,7 +189,7 @@ class MeshroomApp(QApplication):
def __init__(self, args):
meshroom.core.initPipelines()

QtArgs = [args[0], '-style', 'fusion'] + args[1:] # force Fusion style by default
QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default

args = createMeshroomParser(args)

Expand All @@ -202,8 +203,6 @@ def __init__(self, args):
}
logging.getLogger().setLevel(logStringToPython[args.verbose])

QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)

super(MeshroomApp, self).__init__(QtArgs)

self.setOrganizationName('AliceVision')
Expand Down Expand Up @@ -355,6 +354,7 @@ def _recentProjectFiles(self):
p = {"path": p, "thumbnail": thumbnail}
projects.append(p)
settings.endArray()
settings.endGroup()
return projects

@Slot(str)
Expand Down Expand Up @@ -394,6 +394,7 @@ def addRecentProjectFile(self, projectFile):
settings.setArrayIndex(i)
settings.setValue("filepath", p)
settings.endArray()
settings.endGroup()
settings.sync()

self.recentProjectFilesChanged.emit()
Expand Down Expand Up @@ -539,7 +540,8 @@ def _systemInfo(self):
import sys
return {
'platform': '{} {}'.format(platform.system(), platform.release()),
'python': 'Python {}'.format(sys.version.split(" ")[0])
'python': 'Python {}'.format(sys.version.split(" ")[0]),
'pyside': 'PySide6 {}'.format(PySideVersion)
}

systemInfo = Property(QJsonValue, _systemInfo, constant=True)
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import traceback
from contextlib import contextmanager

from PySide2.QtWidgets import QUndoCommand, QUndoStack
from PySide2.QtCore import Property, Signal
from PySide6.QtGui import QUndoCommand, QUndoStack
from PySide6.QtCore import Property, Signal

from meshroom.core.attribute import ListAttribute, Attribute
from meshroom.core.graph import GraphModification
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

def registerTypes():
from PySide2.QtQml import qmlRegisterType
from PySide6.QtQml import qmlRegisterType
from meshroom.ui.components.clipboard import ClipboardHelper
from meshroom.ui.components.edge import EdgeMouseArea
from meshroom.ui.components.filepath import FilepathHelper
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/clipboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide2.QtCore import Slot, QObject
from PySide2.QtGui import QClipboard
from PySide6.QtCore import Slot, QObject
from PySide6.QtGui import QClipboard


class ClipboardHelper(QObject):
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/csvData.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from meshroom.common.qt import QObjectListModel

from PySide2.QtCore import QObject, Slot, Signal, Property
from PySide2.QtCharts import QtCharts
from PySide6.QtCore import QObject, Slot, Signal, Property
from PySide6 import QtCharts

import csv
import os
Expand Down
10 changes: 5 additions & 5 deletions meshroom/ui/components/edge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide2.QtCore import Signal, Property, QPointF, Qt, QObject
from PySide2.QtGui import QPainterPath, QVector2D
from PySide2.QtQuick import QQuickItem
from PySide6.QtCore import Signal, Property, QPointF, Qt, QObject
from PySide6.QtGui import QPainterPath, QVector2D
from PySide6.QtQuick import QQuickItem


class MouseEvent(QObject):
Expand All @@ -9,8 +9,8 @@ class MouseEvent(QObject):
"""
def __init__(self, evt):
super(MouseEvent, self).__init__()
self._x = evt.x()
self._y = evt.y()
self._x = evt.position().x()
self._y = evt.position().y()
self._button = evt.button()
self._modifiers = evt.modifiers()

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/filepath.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# coding:utf-8
from PySide2.QtCore import QUrl, QFileInfo
from PySide2.QtCore import QObject, Slot
from PySide6.QtCore import QUrl, QFileInfo
from PySide6.QtCore import QObject, Slot

import os
import glob
Expand Down
42 changes: 30 additions & 12 deletions meshroom/ui/components/scene3D.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from math import acos, pi, sqrt, atan2, cos, sin, asin

from PySide2.QtCore import QObject, Slot, QSize, Signal, QPointF
from PySide2.Qt3DCore import Qt3DCore
from PySide2.Qt3DRender import Qt3DRender
from PySide2.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4
from PySide6.QtCore import QObject, Slot, QSize, Signal, QPointF
from PySide6.Qt3DCore import Qt3DCore
from PySide6.Qt3DRender import Qt3DRender
from PySide6.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4

from meshroom.ui.utils import makeProperty

Expand Down Expand Up @@ -41,14 +41,14 @@ def vertexCount(self, entity):
def faceCount(self, entity):
""" Returns face count based on children QGeometry buffers size."""
count = 0
for geo in entity.findChildren(Qt3DRender.QGeometry):
for geo in entity.findChildren(Qt3DCore.QGeometry):
count += sum([attr.count() for attr in geo.attributes() if attr.name() == "vertexPosition"])
return count / 3

@Slot(Qt3DCore.QEntity, result=int)
def vertexColorCount(self, entity):
count = 0
for geo in entity.findChildren(Qt3DRender.QGeometry):
for geo in entity.findChildren(Qt3DCore.QGeometry):
count += sum([attr.count() for attr in geo.attributes() if attr.name() == "vertexColor"])
return count

Expand All @@ -59,10 +59,12 @@ class TrackballController(QObject):
Based on the C++ version from https://github.com/cjmdaixi/Qt3DTrackball
"""

_windowSize = QSize()
_camera = None
_trackballSize = 1.0
_rotationSpeed = 5.0
def __init__(self, parent=None):
super().__init__(parent)
self._windowSize = QSize()
self._camera = None
self._trackballSize = 1.0
self._rotationSpeed = 5.0

def projectToTrackball(self, screenCoords):
sx = screenCoords.x()
Expand Down Expand Up @@ -98,7 +100,7 @@ def rotate(self, lastPosition, currentPosition, dt):
windowSizeChanged = Signal()
windowSize = makeProperty(QSize, '_windowSize', windowSizeChanged)
cameraChanged = Signal()
camera = makeProperty(Qt3DRender.QCamera, '_camera', cameraChanged)
camera = makeProperty(QObject, '_camera', cameraChanged)
trackballSizeChanged = Signal()
trackballSize = makeProperty(float, '_trackballSize', trackballSizeChanged)
rotationSpeedChanged = Signal()
Expand Down Expand Up @@ -352,7 +354,23 @@ def convertRotationFromCV2GL(self, rotation):
U = M * quaternion * M

return U.toEulerAngles()


@Slot(QVector3D, QVector3D, float, float, result=QVector3D)
def getRotatedCameraViewVector(self, camereViewVector, cameraUpVector, pitch, yaw):
""" Compute the rotated camera view vector with given pitch and yaw (in degrees).
Args:
camereViewVector (QVector3D): Camera view vector, the displacement from the camera position to its target
cameraUpVector (QVector3D): Camera up vector, the direction the top of the camera is facing
pitch (float): Rotation pitch (in degrees)
yaw (float): Rotation yaw (in degrees)
Returns:
QVector3D: rotated camera view vector
"""
cameraSideVector = QVector3D.crossProduct(camereViewVector, cameraUpVector)
yawRot = QQuaternion.fromAxisAndAngle(cameraUpVector, yaw)
pitchRot = QQuaternion.fromAxisAndAngle(cameraSideVector, pitch)
return (yawRot * pitchRot).rotatedVector(camereViewVector)

@Slot(QVector3D, QMatrix4x4, Qt3DRender.QCamera, QSize, result=float)
def computeScaleUnitFromModelMatrix(self, axis, modelMat, camera, windowSize):
""" Compute the length of the screen projected vector axis unit transformed by the model matrix.
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/components/scriptEditor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide2.QtCore import QObject, Slot
from PySide6.QtCore import QObject, Slot

from io import StringIO
from contextlib import redirect_stdout
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from meshroom.common import Signal

from PySide2.QtCore import QObject, Slot, QSize, QUrl, Qt, QStandardPaths
from PySide2.QtGui import QImageReader, QImageWriter
from PySide6.QtCore import QObject, Slot, QSize, QUrl, Qt, QStandardPaths
from PySide6.QtGui import QImageReader, QImageWriter

import os
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from threading import Thread, Event, Lock
from multiprocessing.pool import ThreadPool

from PySide2.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint
from PySide6.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint

from meshroom.core import sessionUid
from meshroom.common.qt import QObjectListModel
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/palette.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide2.QtCore import QObject, Qt, Slot, Property, Signal
from PySide2.QtGui import QPalette, QColor
from PySide2.QtWidgets import QApplication
from PySide6.QtCore import QObject, Qt, Slot, Property, Signal
from PySide6.QtGui import QPalette, QColor
from PySide6.QtWidgets import QApplication


class PaletteManager(QObject):
Expand Down
22 changes: 13 additions & 9 deletions meshroom/ui/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.11
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Utils 1.0
import MaterialIcons 2.2


/// Meshroom "About" window
/**
* Meshroom "About" window
*/

Dialog {
id: root

Expand All @@ -24,7 +27,7 @@ Dialog {
modal: true
closePolicy: Dialog.CloseOnEscape | Dialog.CloseOnPressOutside
padding: 30
topPadding: 0 // header provides top padding
topPadding: 0 // Header provides top padding

header: Pane {
background: Item {}
Expand Down Expand Up @@ -56,7 +59,8 @@ Dialog {
selectByMouse: true
text: "Version " + Qt.application.version + "\n"
+ MeshroomApp.systemInfo["platform"] + " \n"
+ MeshroomApp.systemInfo["python"]
+ MeshroomApp.systemInfo["python"] + "\n"
+ MeshroomApp.systemInfo["pyside"]
}
}

Expand Down Expand Up @@ -174,16 +178,16 @@ Dialog {
sourceComponent: ScrollView {

Component.onCompleted: {
// try to load the local file
// Try to load the local file
var url = Filepath.stringToUrl(modelData.localUrl)
// fallback to the online url if file is not found
// Fallback to the online url if file is not found
if (!Filepath.exists(url))
url = modelData.onlineUrl
Request.get(url,
function(xhr) {
if (xhr.readyState === XMLHttpRequest.DONE)
{
// status is OK
// Status is OK
if (xhr.status === 200)
textArea.text = MeshroomApp.markdownToHtml(xhr.responseText)
else
Expand Down
Loading
Loading