mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-22 21:46:28 +02:00
[ui] Reconstruction: rename 'endNode' to 'texturing'
+ use makeProperty helper
This commit is contained in:
parent
c750331c02
commit
00857a7a88
2 changed files with 8 additions and 21 deletions
|
@ -133,8 +133,8 @@ Item {
|
||||||
|
|
||||||
// Load reconstructed model
|
// Load reconstructed model
|
||||||
Button {
|
Button {
|
||||||
readonly property var outputAttribute: _reconstruction.endNode ? _reconstruction.endNode.attribute("outputMesh") : null
|
readonly property var outputAttribute: _reconstruction.texturing ? _reconstruction.texturing.attribute("outputMesh") : null
|
||||||
readonly property bool outputReady: outputAttribute && _reconstruction.endNode.globalStatus === "SUCCESS"
|
readonly property bool outputReady: outputAttribute && _reconstruction.texturing.globalStatus === "SUCCESS"
|
||||||
readonly property int outputMediaIndex: viewer3D.library.find(outputAttribute)
|
readonly property int outputMediaIndex: viewer3D.library.find(outputAttribute)
|
||||||
|
|
||||||
text: "Load Model"
|
text: "Load Model"
|
||||||
|
@ -142,7 +142,7 @@ Item {
|
||||||
anchors.bottomMargin: 10
|
anchors.bottomMargin: 10
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: outputReady && outputMediaIndex == -1
|
visible: outputReady && outputMediaIndex == -1
|
||||||
onClicked: viewer3D.view(_reconstruction.endNode.attribute("outputMesh"))
|
onClicked: viewer3D.view(_reconstruction.texturing.attribute("outputMesh"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ class Reconstruction(UIGraph):
|
||||||
self._buildingIntrinsics = False
|
self._buildingIntrinsics = False
|
||||||
self._cameraInit = None
|
self._cameraInit = None
|
||||||
self._cameraInits = QObjectListModel(parent=self)
|
self._cameraInits = QObjectListModel(parent=self)
|
||||||
self._endNode = None
|
self._texturing = None
|
||||||
self.intrinsicsBuilt.connect(self.onIntrinsicsAvailable)
|
self.intrinsicsBuilt.connect(self.onIntrinsicsAvailable)
|
||||||
self.graphChanged.connect(self.onGraphChanged)
|
self.graphChanged.connect(self.onGraphChanged)
|
||||||
self._liveSfmManager = LiveSfmManager(self)
|
self._liveSfmManager = LiveSfmManager(self)
|
||||||
|
@ -212,7 +212,7 @@ class Reconstruction(UIGraph):
|
||||||
""" React to the change of the internal graph. """
|
""" React to the change of the internal graph. """
|
||||||
self._liveSfmManager.reset()
|
self._liveSfmManager.reset()
|
||||||
self.sfm = None
|
self.sfm = None
|
||||||
self.endNode = None
|
self.texturing = None
|
||||||
self.updateCameraInits()
|
self.updateCameraInits()
|
||||||
if not self._graph:
|
if not self._graph:
|
||||||
return
|
return
|
||||||
|
@ -493,21 +493,8 @@ class Reconstruction(UIGraph):
|
||||||
self._sfm.chunks[0].statusChanged.disconnect(self.updateViewsAndPoses)
|
self._sfm.chunks[0].statusChanged.disconnect(self.updateViewsAndPoses)
|
||||||
self._sfm.destroyed.disconnect(self._unsetSfm)
|
self._sfm.destroyed.disconnect(self._unsetSfm)
|
||||||
self._setSfm(node)
|
self._setSfm(node)
|
||||||
self.setEndNode(self.lastNodeOfType("Texturing", self._sfm, Status.SUCCESS))
|
|
||||||
|
|
||||||
def setEndNode(self, node=None):
|
self.texturing = self.lastNodeOfType("Texturing", self._sfm, Status.SUCCESS)
|
||||||
if self._endNode == node:
|
|
||||||
return
|
|
||||||
if self._endNode:
|
|
||||||
try:
|
|
||||||
self._endNode.destroyed.disconnect(self.setEndNode)
|
|
||||||
except RuntimeError:
|
|
||||||
# self._endNode might have been destroyed at this point, causing PySide2 to throw a RuntimeError
|
|
||||||
pass
|
|
||||||
self._endNode = node
|
|
||||||
if self._endNode:
|
|
||||||
self._endNode.destroyed.connect(self.setEndNode)
|
|
||||||
self.endNodeChanged.emit()
|
|
||||||
|
|
||||||
@Slot(QObject, result=bool)
|
@Slot(QObject, result=bool)
|
||||||
def isInViews(self, viewpoint):
|
def isInViews(self, viewpoint):
|
||||||
|
@ -570,8 +557,8 @@ class Reconstruction(UIGraph):
|
||||||
# convenient property for QML binding re-evaluation when sfm report changes
|
# convenient property for QML binding re-evaluation when sfm report changes
|
||||||
sfmReport = Property(bool, lambda self: len(self._poses) > 0, notify=sfmReportChanged)
|
sfmReport = Property(bool, lambda self: len(self._poses) > 0, notify=sfmReportChanged)
|
||||||
sfmAugmented = Signal(Node, Node)
|
sfmAugmented = Signal(Node, Node)
|
||||||
endNodeChanged = Signal()
|
texturingChanged = Signal()
|
||||||
endNode = Property(QObject, lambda self: self._endNode, setEndNode, notify=endNodeChanged)
|
texturing = makeProperty(QObject, "_texturing", notify=texturingChanged)
|
||||||
|
|
||||||
nbCameras = Property(int, reconstructedCamerasCount, notify=sfmReportChanged)
|
nbCameras = Property(int, reconstructedCamerasCount, notify=sfmReportChanged)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue