From 6f4541f76b712afde3aceef145d259a97da83878 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Sun, 6 Feb 2022 20:17:28 +0100 Subject: [PATCH 1/2] [core] add env var to load nodes from multiple folders New env var: MESHROOM_NODES_PATH --- meshroom/core/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meshroom/core/__init__.py b/meshroom/core/__init__.py index 7f9760d3b3..968f620aac 100644 --- a/meshroom/core/__init__.py +++ b/meshroom/core/__init__.py @@ -272,9 +272,15 @@ def loadSubmitters(folder, packageName): meshroomFolder = os.path.dirname(os.path.dirname(__file__)) +additionalNodesPath = os.environ.get("MESHROOM_NODES_PATH", "").split(os.pathsep) + # Load plugins: # - Nodes -loadAllNodes(folder=os.path.join(meshroomFolder, 'nodes')) +nodesFolders = [os.path.join(meshroomFolder, 'nodes')] + additionalNodesPath + +for f in nodesFolders: + loadAllNodes(folder=f) + # - Submitters subs = loadSubmitters(os.environ.get("MESHROOM_SUBMITTERS_PATH", meshroomFolder), 'submitters') From 0fec646776630c94584160fcfa681875ef75d50c Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 22 Feb 2022 15:12:00 +0100 Subject: [PATCH 2/2] Avoid to load project nodes twice --- meshroom/core/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshroom/core/__init__.py b/meshroom/core/__init__.py index 968f620aac..834ace0ae2 100644 --- a/meshroom/core/__init__.py +++ b/meshroom/core/__init__.py @@ -273,6 +273,8 @@ def loadSubmitters(folder, packageName): meshroomFolder = os.path.dirname(os.path.dirname(__file__)) additionalNodesPath = os.environ.get("MESHROOM_NODES_PATH", "").split(os.pathsep) +# filter empty strings +additionalNodesPath = [i for i in additionalNodesPath if i] # Load plugins: # - Nodes