Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mouse for camera controller #2566

Open
wants to merge 51 commits into
base: dev/qt6.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1835dec
[requirements] Update requirement for PySide to PySide 6.6.3.1
cbentejac Oct 1, 2024
4479e47
[qt6] Replace all `PySide2/shiboken2` imports by `PySide6/shiboken6`
cbentejac Oct 1, 2024
25b1777
[qt6] Remove imports of QML modules that do not exist anymore with Qt6.6
cbentejac Oct 1, 2024
b5b46a0
[qt6] Remove properties that do not exist anymore in Qt6.6
cbentejac Oct 1, 2024
8a748a8
[qt6] Use exec() instead of deprecated exec_() in __main__.py
cbentejac Oct 1, 2024
dacb6d0
[qt6] Re-enable alternative base and keyboard shortcut to switch to it
cbentejac Oct 1, 2024
5713f8d
[qt6] Replace Qt.labs.settings with QtCore.Settings
cbentejac Oct 1, 2024
ef8458e
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
5b9601f
[qt6] Update versions for all the imported modules
cbentejac Oct 1, 2024
b9e46a5
[qt6][GraphEditor] Rename identifiers for attribute items
cbentejac Oct 1, 2024
2854c32
[qt6][GraphEditor] Fix `ColorDialog` selection
cbentejac Oct 1, 2024
59cf227
[qt6][qml] Do not explicitly set a Palette value with a QPalette
cbentejac Oct 1, 2024
d4044c6
[qt6] Remove shaders from Meshroom and move them to QtAliceVision
cbentejac Oct 1, 2024
2984352
[qt6] Set the RHI backend to "opengl"
cbentejac Oct 1, 2024
eba6518
[qt6][Materials] Use correct graphics API and update SH shaders
cbentejac Oct 1, 2024
4eb983b
[qt6][components] Update Scene3DHelper and TrackballController
cbentejac Oct 1, 2024
02181fd
[qt6][Viewer3D] MediaLibrary: Fix loading medias from attributes
cbentejac Oct 1, 2024
5ae7443
[qt6] Update setup script with the correct version of PySide
cbentejac Oct 1, 2024
a1788a2
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
c366d07
[qt6] Stop enabling HighDpiScaling which is now deprecated
cbentejac Oct 1, 2024
1dce260
[qt6][Viewer3D] Remove `PointSize` render state
cbentejac Oct 1, 2024
fcb21a3
[qt6][Viewer3D] Inspector3D: Set color for labels in Inspector
cbentejac Oct 1, 2024
1698bb5
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
e7ac2d3
[qt6][Viewer] Viewer2D: Trigger auto-fit() on correct events
cbentejac Oct 1, 2024
e72c54a
[qt6][Viewer3D] Disable wireframe mode
cbentejac Oct 1, 2024
9775808
[qt6] Use JS functions format to declare explicit parameters in slots
cbentejac Oct 1, 2024
6fe2b5f
[qt6][core] Don't store `SignalInstance` in dict for node computations
cbentejac Oct 1, 2024
21ff7ea
[qt6][GraphEditor] Check for object's existence before accessing it
cbentejac Oct 1, 2024
dc780f5
[qt6][Viewer3D] Use `DiffuseMapMaterial` for texture display
cbentejac Oct 1, 2024
9e92ba3
[qt6][GraphEditor] Correctly detect clicks on edges
cbentejac Oct 1, 2024
9ea19f3
[qt6][GraphEditor] Set preferred size for the list of chunks
cbentejac Oct 1, 2024
7db2cf9
[qt6][Viewer] Fix display of metadata
cbentejac Oct 1, 2024
441bb09
[qt6][MaterialIcons] Fix disabled buttons' behaviour when interacted …
cbentejac Oct 1, 2024
5e0edd8
[qt6][GraphEditor] Fix the width for the TaskManager's list
cbentejac Oct 1, 2024
77db282
[qt6][qml] Remove `QtQuick.Window` imports
cbentejac Oct 1, 2024
13ed0ca
[qt6][ImageGallery] IntrinsicDisplay: Harmonize naming of components
cbentejac Oct 1, 2024
b47a4f1
[qt6][ui] AboutDialog: Display PySide's version
cbentejac Oct 2, 2024
9d8e9f8
[qt6][qml] Push `Application` on the stack before loading the project
cbentejac Oct 2, 2024
73e7925
[qt6][qml] Homepage: Improve minimum width
cbentejac Oct 2, 2024
0f3390d
[qt6][Viewer] Viewer2D: Remove outdated `sfmRequired` property
cbentejac Oct 3, 2024
0994543
[components] Edge: Remove use of deprecated functions
cbentejac Oct 8, 2024
31839fa
[GraphEditor] Edge: Set curve scale after initializing `EdgeMouseArea`
cbentejac Oct 8, 2024
7dfa258
[qt6][GraphEditor] Fix connections to `ListAttribute` pins
cbentejac Oct 10, 2024
27a5d58
[qt6][Charts] InteractiveChartView: Remove dead code and useless imports
cbentejac Oct 10, 2024
9343e96
[qt6][qml] Remove unnecessary module imports
cbentejac Oct 11, 2024
be0fe0e
[qt6][qml] Clean-up code and harmonize comments
cbentejac Oct 10, 2024
ab0fdd8
[qt6] Add QT6 support for wireframe on nvidia
cbentejac Oct 11, 2024
37a4a82
[qt6] Viewer3D: Reset the default render mode to "Textured"
cbentejac Oct 11, 2024
16832f8
[qt6][Viewer3D] Change picking behavior
cbentejac Oct 11, 2024
d0b7b92
[qt6][Viewer] Fix zoom in 8bits viewer
servantftechnicolor Oct 9, 2024
d1fddf2
fix mouse camera controller
servantftechnicolor Oct 9, 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: 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 @@ -115,8 +115,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()
16 changes: 8 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 @@ -539,7 +538,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
24 changes: 13 additions & 11 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
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
26 changes: 13 additions & 13 deletions meshroom/ui/qml/Application.qml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.11
import QtQuick.Window 2.15
import QtQml.Models 2.15
import QtCore

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml.Models

import Qt.labs.platform 1.0 as Platform
import QtQuick.Dialogs 1.3
import QtQuick.Dialogs

import Qt.labs.settings 1.0
import GraphEditor 1.0
import MaterialIcons 2.2
import Utils 1.0
Expand All @@ -22,7 +22,7 @@ Page {

Settings {
id: settingsUILayout
category: 'UILayout'
category: "UILayout"
property alias showLiveReconstruction: liveSfMVisibilityCB.checked
property alias showGraphEditor: graphEditorVisibilityCB.checked
property alias showImageViewer: imageViewerVisibilityCB.checked
Expand Down Expand Up @@ -521,8 +521,8 @@ Page {
text: "Load Template"
onTriggered: {
ensureSaved(function() {
initFileDialogFolder(loadTemplateDialog);
loadTemplateDialog.open();
initFileDialogFolder(loadTemplateDialog)
loadTemplateDialog.open()
})
}
}
Expand Down Expand Up @@ -1158,15 +1158,15 @@ Page {
uigraph: _reconstruction
nodeTypesModel: _nodeTypes

onNodeDoubleClicked: {
onNodeDoubleClicked: function(mouse, node) {
_reconstruction.setActiveNode(node);
workspaceView.viewNode(node, mouse);
}
onComputeRequest: {
onComputeRequest: function(nodes) {
_reconstruction.forceNodesStatusUpdate();
computeManager.compute(nodes)
}
onSubmitRequest: {
onSubmitRequest: function(nodes) {
_reconstruction.forceNodesStatusUpdate();
computeManager.submit(nodes)
}
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/qml/Charts/ChartViewCheckBox.qml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

import QtQuick
import QtQuick.Controls

/**
* A custom CheckBox designed to be used in ChartView's legend.
*/

CheckBox {
id: root

Expand Down
Loading
Loading