Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea95d40

Browse files
author
Matthieu Hog
committedSep 12, 2024·
added build aciton, should auto update
1 parent c530fa9 commit ea95d40

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed
 

‎meshroom/core/desc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def buildCommandLine(self, chunk):
776776
#the process in Popen does not seem to use the right python, even if meshroom_compute is called within the env
777777
#so in the case of command line using python, we have to make sure it is using the correct python
778778
from meshroom.core.plugin import EnvType, getVenvPath, getVenvExe #lazy import to prevent circular dep
779-
if self.isPlugin() and self.envType == EnvType.VENV:
779+
if self.isPlugin and self.envType == EnvType.VENV:
780780
envPath = getVenvPath(self._envName)
781781
envExe = getVenvExe(envPath)
782782
cmd=cmd.replace("python", envExe)

‎meshroom/core/graph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,8 @@ def upgradeNode(self, nodeName):
774774
logging.warning("Failed to restore edge {} -> {}: {}".format(src, dst, str(e)))
775775

776776
return upgradedNode, inEdges, outEdges, outListAttributes
777-
777+
778+
778779
def upgradeAllNodes(self):
779780
""" Upgrade all upgradable CompatibilityNode instances in the graph. """
780781
nodeNames = [name for name, n in self._compatibilityNodes.items() if n.canUpgrade]

‎meshroom/ui/qml/Application.qml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1358,8 +1358,15 @@ Page {
13581358
}
13591359

13601360
onDoBuild: {
1361-
console.log(node)
1362-
node.nodeDesc
1361+
try {
1362+
_reconstruction.buildNode(node.name)
1363+
node.isNotBuilt=false
1364+
} catch (error) {
1365+
//NOTE: could do an error popup
1366+
console.log("Build error:")
1367+
console.log(error)
1368+
}
1369+
13631370
}
13641371
}
13651372
}

‎meshroom/ui/qml/GraphEditor/Node.qml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Item {
2121
readonly property bool isCompatibilityNode: node ? node.hasOwnProperty("compatibilityIssue") : false
2222
/// Whether the node is a plugin that needs to be build
2323
readonly property bool isPlugin: node ? node.isPlugin : false
24-
readonly property bool isNotBuilt: node ? (!node.isBuilt) : false
24+
property bool isNotBuilt: node ? (!node.isBuilt) : false
2525
/// Mouse related states
2626
property bool mainSelected: false
2727
property bool selected: false

‎meshroom/ui/reconstruction.py

+8
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,14 @@ def installPlugin(self, url):
586586
localFile = prepareUrlLocalFile(url)
587587
return installPlugin(localFile)
588588

589+
@Slot(str, result=bool)
590+
def buildNode(self, nodeName):
591+
print("***Building "+nodeName)
592+
node = self._graph.node(nodeName)
593+
from meshroom.core.plugin import isBuilt, build #lazy import to avoid circular dep
594+
if not isBuilt(node.nodeDesc):
595+
build(node.nodeDesc)
596+
589597
def onGraphChanged(self):
590598
""" React to the change of the internal graph. """
591599
self._liveSfmManager.reset()

0 commit comments

Comments
 (0)
Please sign in to comment.