Skip to content

Commit 55fc3a9

Browse files
authored
Merge pull request #2849 from alicevision/dev/pythonExecutable
[core] desc.node: Support the use of custom Python executables for `meshroom_compute`
2 parents 194029c + 011cc0c commit 55fc3a9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

meshroom/core/desc/node.py

Lines changed: 6 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):
@@ -263,6 +262,7 @@ def processChunk(self, chunk):
263262

264263

265264
class Node(BaseNode):
265+
pythonExecutable = "python"
266266

267267
def __init__(self):
268268
super(Node, self).__init__()
@@ -271,15 +271,18 @@ def getMrNodeType(self):
271271
return MrNodeType.NODE
272272

273273
def processChunkInEnvironment(self, chunk):
274-
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"
275277

276278
if len(chunk.node.getChunks()) > 1:
277279
meshroomComputeCmd += f" --iteration {chunk.range.iteration}"
278280

279281
runtimeEnv = chunk.node.nodeDesc.plugin.runtimeEnv
280282
cmdPrefix = chunk.node.nodeDesc.plugin.commandPrefix
281283
cmdSuffix = chunk.node.nodeDesc.plugin.commandSuffix
282-
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, env=runtimeEnv)
284+
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix,
285+
env=runtimeEnv)
283286

284287

285288
class CommandLineNode(BaseNode):

0 commit comments

Comments
 (0)