Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions meshroom/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from meshroom.ui.components.messaging import MessageController
from meshroom.ui.components.shapes import ShapeFilesHelper, ShapeViewerHelper
from meshroom.ui.palette import PaletteManager
from meshroom.ui.reconstruction import Reconstruction
from meshroom.ui.scene import Scene
from meshroom.ui.utils import QmlInstantEngine
from meshroom.ui import commands

Expand Down Expand Up @@ -281,13 +281,13 @@ def __init__(self, inputArgs):
# expose available node types that can be instantiated
self.engine.rootContext().setContextProperty("_nodeTypes", {n: {"category": pluginManager.getRegisteredNodePlugins()[n].nodeDescriptor.category} for n in sorted(pluginManager.getRegisteredNodePlugins().keys())})

# instantiate Reconstruction object
# instantiate the 3D Scene object
self._undoStack = commands.UndoStack(self)
self._defaultSubmitterName = os.environ.get('MESHROOM_DEFAULT_SUBMITTER', '')
self._taskManager = TaskManager(self)
self._activeProject = Reconstruction(undoStack=self._undoStack, taskManager=self._taskManager, defaultPipeline=args.pipeline, parent=self)
self._activeProject = Scene(undoStack=self._undoStack, taskManager=self._taskManager, defaultPipeline=args.pipeline, parent=self)
self._activeProject.setSubmitLabel(args.submitLabel)
self.engine.rootContext().setContextProperty("_reconstruction", self._activeProject)
self.engine.rootContext().setContextProperty("_currentScene", self._activeProject)

# those helpers should be available from QML Utils module as singletons, but:
# - qmlRegisterUncreatableType is not yet available in PySide2
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/components/shapes/shapeFilesHelper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from meshroom.ui.reconstruction import Reconstruction
from meshroom.ui.scene import Scene
from meshroom.common import BaseObject, Property, Variant, Signal, ListModel, Slot
from meshroom.core.attribute import GroupAttribute, ListAttribute
from shiboken6 import isValid
Expand All @@ -13,7 +13,7 @@ class ShapeFilesHelper(BaseObject):
Manages active project selected node shape files.
"""

def __init__(self, activeProject:Reconstruction, parent=None):
def __init__(self, activeProject:Scene, parent=None):
super().__init__(parent)
self._activeProject = activeProject
self._currentNode = activeProject.selectedNode
Expand Down
186 changes: 93 additions & 93 deletions meshroom/ui/qml/Application.qml

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RowLayout {
property int labelWidth // Shortcut to set the fixed size of the Label

readonly property bool editable: !attribute.isOutput && !attribute.isLink &&
!readOnly && !(attribute.keyable && _reconstruction.selectedViewId === "-1")
!readOnly && !(attribute.keyable && _currentScene.selectedViewId === "-1")

signal doubleClicked(var mouse, var attr)
signal inAttributeClicked(var srcItem, var mouse, var inAttributes)
Expand Down Expand Up @@ -144,7 +144,7 @@ RowLayout {
text: "Reset To Default Value"
enabled: root.editable && !attribute.isDefault
onTriggered: {
_reconstruction.resetAttribute(attribute)
_currentScene.resetAttribute(attribute)
updateAttributeLabel()
}
}
Expand All @@ -160,7 +160,7 @@ RowLayout {
text: "Paste"
enabled: Clipboard.getText() != "" && !attribute.keyable && root.editable
onTriggered: {
_reconstruction.setAttribute(attribute, Clipboard.getText())
_currentScene.setAttribute(attribute, Clipboard.getText())
}
}

Expand Down Expand Up @@ -210,7 +210,7 @@ RowLayout {

MaterialLabel {
property bool isDisplayable: attribute.isOutput && (attribute.is2dDisplayable || attribute.is3dDisplayable)
property bool isDisplayed: attribute === _reconstruction.displayedAttr2D || _reconstruction.displayedAttrs3D.count && _reconstruction.displayedAttrs3D.contains(attribute)
property bool isDisplayed: attribute === _currentScene.displayedAttr2D || _currentScene.displayedAttrs3D.count && _currentScene.displayedAttrs3D.contains(attribute)
text: isDisplayed ? MaterialIcons.visibility : MaterialIcons.visibility_off
enabled: isDisplayed
visible: isDisplayable
Expand Down Expand Up @@ -262,16 +262,16 @@ RowLayout {
case "FloatParam":
// We don't set a number because we want to keep the invalid expression
if(attribute.keyable)
_reconstruction.addAttributeKeyValue(root.attribute, _reconstruction.selectedViewId, Number(value))
_currentScene.addAttributeKeyValue(root.attribute, _currentScene.selectedViewId, Number(value))
else
_reconstruction.setAttribute(root.attribute, Number(value))
_currentScene.setAttribute(root.attribute, Number(value))
updateAttributeLabel()
break
case "File":
_reconstruction.setAttribute(root.attribute, value)
_currentScene.setAttribute(root.attribute, value)
break
default:
_reconstruction.setAttribute(root.attribute, value.trim())
_currentScene.setAttribute(root.attribute, value.trim())
updateAttributeLabel()
break
}
Expand Down Expand Up @@ -517,11 +517,11 @@ RowLayout {
onClicked: {
if (checked) {
if (colorText.text == "")
_reconstruction.setAttribute(attribute, "#0000FF")
_currentScene.setAttribute(attribute, "#0000FF")
else
_reconstruction.setAttribute(attribute, colorText.text)
_currentScene.setAttribute(attribute, colorText.text)
} else {
_reconstruction.setAttribute(attribute, "")
_currentScene.setAttribute(attribute, "")
}
}
}
Expand Down Expand Up @@ -583,7 +583,7 @@ RowLayout {
enabled: root.editable

onEditingFinished: (value) => {
_reconstruction.setAttribute(root.attribute, value)
_currentScene.setAttribute(root.attribute, value)
}
}
}
Expand All @@ -603,7 +603,7 @@ RowLayout {
} else {
currentValue.push(value);
}
_reconstruction.setAttribute(attribute, currentValue);
_currentScene.setAttribute(attribute, currentValue);
}
}
}
Expand All @@ -618,7 +618,7 @@ RowLayout {
enabled: root.editable
// Cast value to string to avoid intrusive scientific notations on numbers
property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue :
attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_reconstruction.selectedViewId) :
attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) :
attribute.value)
text: displayValue
selectByMouse: true
Expand Down Expand Up @@ -667,7 +667,7 @@ RowLayout {
readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0
readonly property real formattedValue: value.toFixed(stepDecimalCount)
enabled: root.editable
value: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_reconstruction.selectedViewId) : attribute.value
value: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value
from: attribute.desc.range[0]
to: attribute.desc.range[1]
stepSize: attribute.desc.range[2]
Expand All @@ -676,9 +676,9 @@ RowLayout {
onPressedChanged: {
if (!pressed) {
if(attribute.keyable)
_reconstruction.addAttributeKeyValue(attribute, _reconstruction.selectedViewId, formattedValue)
_currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, formattedValue)
else
_reconstruction.setAttribute(attribute, formattedValue)
_currentScene.setAttribute(attribute, formattedValue)
updateAttributeLabel()
}
}
Expand All @@ -692,16 +692,16 @@ RowLayout {
Row {
CheckBox {
enabled: root.editable
checked: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_reconstruction.selectedViewId) : attribute.value
checked: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value
onToggled: {
if(attribute.keyable)
{
const value = attribute.keyValues.getValueAtKeyOrDefault(_reconstruction.selectedViewId)
_reconstruction.addAttributeKeyValue(attribute, _reconstruction.selectedViewId, !value)
const value = attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId)
_currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, !value)
}
else
{
_reconstruction.setAttribute(attribute, !attribute.value)
_currentScene.setAttribute(attribute, !attribute.value)
}
}
}
Expand Down Expand Up @@ -731,7 +731,7 @@ RowLayout {
font.pointSize: 11
padding: 2
enabled: root.editable
onClicked: _reconstruction.appendAttribute(attribute, undefined)
onClicked: _currentScene.appendAttribute(attribute, undefined)
}
}
ListView {
Expand Down Expand Up @@ -779,7 +779,7 @@ RowLayout {
padding: 2
ToolTip.text: "Remove Element"
ToolTip.visible: hovered
onClicked: _reconstruction.removeAttribute(item.childAttrib)
onClicked: _currentScene.removeAttribute(item.childAttrib)
}
}
}
Expand Down Expand Up @@ -860,7 +860,7 @@ RowLayout {
snapMode: Slider.SnapAlways
onPressedChanged: {
if (!pressed)
_reconstruction.setAttribute(attribute, formattedValue)
_currentScene.setAttribute(attribute, formattedValue)
}

background: ShaderEffect {
Expand All @@ -882,13 +882,13 @@ RowLayout {
padding: 6
text: MaterialIcons.circle
checkable: true
checked: attribute.keyable && attribute.keyValues.hasKey(_reconstruction.selectedViewId)
checked: attribute.keyable && attribute.keyValues.hasKey(_currentScene.selectedViewId)
enabled: root.editable
onClicked: {
if (attribute.keyValues.hasKey(_reconstruction.selectedViewId))
_reconstruction.removeAttributeKey(attribute, _reconstruction.selectedViewId)
if (attribute.keyValues.hasKey(_currentScene.selectedViewId))
_currentScene.removeAttributeKey(attribute, _currentScene.selectedViewId)
else
_reconstruction.addAttributeKeyDefaultValue(attribute, _reconstruction.selectedViewId)
_currentScene.addAttributeKeyDefaultValue(attribute, _currentScene.selectedViewId)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/GraphEditor/AttributePin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ RowLayout {

onDropped: function(drop) {
root.edgeAboutToBeRemoved(undefined)
_reconstruction.addEdge(drag.source.attribute, inputDragTarget.attribute)
_currentScene.addEdge(drag.source.attribute, inputDragTarget.attribute)
}
}

Expand Down Expand Up @@ -384,7 +384,7 @@ RowLayout {

onDropped: function(drop) {
root.edgeAboutToBeRemoved(undefined)
_reconstruction.addEdge(outputDragTarget.attribute, drag.source.attribute)
_currentScene.addEdge(outputDragTarget.attribute, drag.source.attribute)
}
}

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/GraphEditor/ChunksListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ ColumnLayout {
}

Connections {
target: _reconstruction
target: _currentScene
function onSelectedChunkChanged() {
for (var i = 0; i < root.chunks.count; i++) {
if (_reconstruction.selectedChunk === root.chunks.at(i)) {
if (_currentScene.selectedChunk === root.chunks.at(i)) {
root.currentIndex = i
break;
}
Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/qml/GraphEditor/NodeEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ Panel {
// Node shape editor
Loader {
id: shapeEditorLoader
active: _reconstruction ?
(_reconstruction.selectedNode ? _reconstruction.selectedNode.hasDisplayableShape : false) : false
active: _currentScene ?
(_currentScene.selectedNode ? _currentScene.selectedNode.hasDisplayableShape : false) : false
sourceComponent: ShapeEditor {
model: root.node.attributes
filterText: searchBar.text
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/qml/Homepage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Page {
function onClicked() {
// Open pipeline
mainStack.push("Application.qml")
_reconstruction.new(modelData["path"])
_currentScene.new(modelData["path"])
}
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ Page {
else {
// Open project
mainStack.push("Application.qml")
if (_reconstruction.load(modelData["path"])) {
if (_currentScene.load(modelData["path"])) {
MeshroomApp.addRecentProjectFile(modelData["path"])
}
}
Expand All @@ -379,7 +379,7 @@ Page {
enabled: projectDelegate.fileExists
text: "Open"
onTriggered: {
if (_reconstruction.load(modelData["path"])) {
if (_currentScene.load(modelData["path"])) {
mainStack.push("Application.qml")
MeshroomApp.addRecentProjectFile(modelData["path"])
}
Expand Down
14 changes: 7 additions & 7 deletions meshroom/ui/qml/ImageGallery/ImageDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,24 @@ Item {
}
MenuItem {
text: "Define As Center Image"
property var activeNode: _reconstruction ? _reconstruction.activeNodes.get("SfMTransform").node : null
enabled: !root.readOnly && _viewpoint.viewId != -1 && _reconstruction && activeNode
onClicked: _reconstruction.setAttribute(activeNode.attribute("transformation"), _viewpoint.viewId.toString())
property var activeNode: _currentScene ? _currentScene.activeNodes.get("SfMTransform").node : null
enabled: !root.readOnly && _viewpoint.viewId != -1 && _currentScene && activeNode
onClicked: _currentScene.setAttribute(activeNode.attribute("transformation"), _viewpoint.viewId.toString())
}
Menu {
id: sfmSetPairMenu
title: "SfM: Define Initial Pair"
property var activeNode: _reconstruction ? _reconstruction.activeNodes.get("StructureFromMotion").node : null
enabled: !root.readOnly && _viewpoint.viewId != -1 && _reconstruction && activeNode
property var activeNode: _currentScene ? _currentScene.activeNodes.get("StructureFromMotion").node : null
enabled: !root.readOnly && _viewpoint.viewId != -1 && _currentScene && activeNode

MenuItem {
text: "A"
onClicked: _reconstruction.setAttribute(sfmSetPairMenu.activeNode.attribute("initialPairA"), _viewpoint.viewId.toString())
onClicked: _currentScene.setAttribute(sfmSetPairMenu.activeNode.attribute("initialPairA"), _viewpoint.viewId.toString())
}

MenuItem {
text: "B"
onClicked: _reconstruction.setAttribute(sfmSetPairMenu.activeNode.attribute("initialPairB"), _viewpoint.viewId.toString())
onClicked: _currentScene.setAttribute(sfmSetPairMenu.activeNode.attribute("initialPairB"), _viewpoint.viewId.toString())
}
}
}
Expand Down
Loading
Loading