|
if not inCurrentEnv and self.node.getMrNodeType() == MrNodeType.NODE: |
|
self._processInIsolatedEnvironment() |
|
return |
Because of this when we launch graph execution, any node based on desc.Node will execute in a subprocess.
On several occasions this isn't necessary, for example for nodes that will do a simple file lookup and don't require a specific environment. There is a workaround which is using desc.CommandLineNode with the processChunk method:
import os
from meshroom.core import desc
class GetFileExt(desc.CommandLineNode):
inputs = [
desc.File(
name="path",
value="",
exposed=True,
),
]
outputs = [
desc.StringParam(
name="extension",
value=None,
),
]
def processChunk(self, chunk):
chunk.node.extension.value = os.path.splitext(chunk.node.path.value)[1]
Comparison:
| mode |
time |
desc.Node |
4.8s |
desc.CommandLineNode |
0.02s |
Meshroom/meshroom/core/node.py
Lines 705 to 707 in 507e2dc
Because of this when we launch graph execution, any node based on
desc.Nodewill execute in a subprocess.On several occasions this isn't necessary, for example for nodes that will do a simple file lookup and don't require a specific environment. There is a workaround which is using
desc.CommandLineNodewith theprocessChunkmethod:Comparison:
desc.Nodedesc.CommandLineNode