From 8366a38deed1fb27fa3c22466fd13192548bd513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 21 Aug 2025 17:54:49 +0200 Subject: [PATCH 1/2] [core] desc.node: Add a `pythonExecutable` member to the `Node` class --- meshroom/core/desc/node.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meshroom/core/desc/node.py b/meshroom/core/desc/node.py index 0484e63c44..436a76f7dc 100644 --- a/meshroom/core/desc/node.py +++ b/meshroom/core/desc/node.py @@ -263,6 +263,7 @@ def processChunk(self, chunk): class Node(BaseNode): + pythonExecutable = "python" def __init__(self): super(Node, self).__init__() From 011cc0c4a29041e2667fa14eade2cda24c40ab7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 17 Sep 2025 12:14:15 +0200 Subject: [PATCH 2/2] [core] desc.node: Use node's Python executable to call `meshroom_compute` If `pythonExecutable` has not been explicitly set in the node's description, then the default `python` will be used. Otherwise, the one set in the description will be used. `_MESHROOM_COMPUTE_EXE` is removed since it is now impossible to determine it outside of the node. --- meshroom/core/desc/node.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meshroom/core/desc/node.py b/meshroom/core/desc/node.py index 436a76f7dc..6c586952ed 100644 --- a/meshroom/core/desc/node.py +++ b/meshroom/core/desc/node.py @@ -17,7 +17,6 @@ _MESHROOM_ROOT = Path(meshroom.__file__).parent.parent.as_posix() _MESHROOM_COMPUTE = (Path(_MESHROOM_ROOT) / "bin" / "meshroom_compute").as_posix() -_MESHROOM_COMPUTE_EXE = f"python {_MESHROOM_COMPUTE}" class MrNodeType(enum.Enum): @@ -272,7 +271,9 @@ def getMrNodeType(self): return MrNodeType.NODE def processChunkInEnvironment(self, chunk): - meshroomComputeCmd = f"{_MESHROOM_COMPUTE_EXE} \"{chunk.node.graph.filepath}\" --node {chunk.node.name} --extern --inCurrentEnv" + meshroomComputeCmd = f"{chunk.node.nodeDesc.pythonExecutable} {_MESHROOM_COMPUTE}" + \ + f" \"{chunk.node.graph.filepath}\" --node {chunk.node.name}" + \ + " --extern --inCurrentEnv" if len(chunk.node.getChunks()) > 1: meshroomComputeCmd += f" --iteration {chunk.range.iteration}" @@ -280,7 +281,8 @@ def processChunkInEnvironment(self, chunk): runtimeEnv = chunk.node.nodeDesc.plugin.runtimeEnv cmdPrefix = chunk.node.nodeDesc.plugin.commandPrefix cmdSuffix = chunk.node.nodeDesc.plugin.commandSuffix - self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, env=runtimeEnv) + self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, + env=runtimeEnv) class CommandLineNode(BaseNode):