Skip to content

Commit df79133

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. This makes the `_MESHROOM_COMPUTE_EXE` variable node-dependent whenever we are not in release mode.
1 parent 1c78056 commit df79133

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

meshroom/core/desc/node.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
_MESHROOM_COMPUTE_EXE = _MESHROOM_COMPUTE
2121
else:
2222
_MESHROOM_COMPUTE = (Path(_MESHROOM_ROOT) / "bin" / "meshroom_compute").as_posix()
23-
_MESHROOM_COMPUTE_EXE = f"python {_MESHROOM_COMPUTE}"
23+
# _MESHROOM_COMPUTE_EXE will be set for each node individually, in case the Python executable for
24+
# that node would differ from "python"
25+
_MESHROOM_COMPUTE_EXE = ""
2426

2527

2628
class MrNodeType(enum.Enum):
@@ -261,7 +263,12 @@ def getMrNodeType(self):
261263
return MrNodeType.NODE
262264

263265
def processChunkInEnvironment(self, chunk):
264-
meshroomComputeCmd = f"{_MESHROOM_COMPUTE_EXE} {chunk.node.graph.filepath} --node {chunk.node.name} --extern --inCurrentEnv"
266+
if _MESHROOM_COMPUTE_EXE == "":
267+
meshroomComputeCmd = f"{chunk.node.nodeDesc.pythonExecutable} {_MESHROOM_COMPUTE}"
268+
else:
269+
meshroomComputeCmd = f"{_MESHROOM_COMPUTE_EXE}"
270+
271+
meshroomComputeCmd += f" {chunk.node.graph.filepath} --node {chunk.node.name} --extern --inCurrentEnv"
265272

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

0 commit comments

Comments
 (0)