Skip to content

Commit 011cc0c

Browse files
committed
[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.
1 parent 8366a38 commit 011cc0c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

meshroom/core/desc/node.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
_MESHROOM_ROOT = Path(meshroom.__file__).parent.parent.as_posix()
1919
_MESHROOM_COMPUTE = (Path(_MESHROOM_ROOT) / "bin" / "meshroom_compute").as_posix()
20-
_MESHROOM_COMPUTE_EXE = f"python {_MESHROOM_COMPUTE}"
2120

2221

2322
class MrNodeType(enum.Enum):
@@ -272,15 +271,18 @@ def getMrNodeType(self):
272271
return MrNodeType.NODE
273272

274273
def processChunkInEnvironment(self, chunk):
275-
meshroomComputeCmd = f"{_MESHROOM_COMPUTE_EXE} \"{chunk.node.graph.filepath}\" --node {chunk.node.name} --extern --inCurrentEnv"
274+
meshroomComputeCmd = f"{chunk.node.nodeDesc.pythonExecutable} {_MESHROOM_COMPUTE}" + \
275+
f" \"{chunk.node.graph.filepath}\" --node {chunk.node.name}" + \
276+
" --extern --inCurrentEnv"
276277

277278
if len(chunk.node.getChunks()) > 1:
278279
meshroomComputeCmd += f" --iteration {chunk.range.iteration}"
279280

280281
runtimeEnv = chunk.node.nodeDesc.plugin.runtimeEnv
281282
cmdPrefix = chunk.node.nodeDesc.plugin.commandPrefix
282283
cmdSuffix = chunk.node.nodeDesc.plugin.commandSuffix
283-
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, env=runtimeEnv)
284+
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix,
285+
env=runtimeEnv)
284286

285287

286288
class CommandLineNode(BaseNode):

0 commit comments

Comments
 (0)