mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 09:47:20 +02:00
Create Init functions for nodes, submitters and pipelines
This commit is contained in:
parent
b173de5a73
commit
a6be4e4938
5 changed files with 34 additions and 24 deletions
|
@ -14,6 +14,7 @@ from meshroom import multiview
|
|||
from meshroom.core.desc import InitNode
|
||||
import logging
|
||||
|
||||
meshroom.core.initPlugins()
|
||||
|
||||
parser = argparse.ArgumentParser(description='Launch the full photogrammetry or Panorama HDR pipeline.')
|
||||
parser.add_argument('-i', '--input', metavar='NODEINSTANCE:"SFM/FOLDERS/IMAGES;..."', type=str, nargs='*',
|
||||
|
|
|
@ -31,6 +31,8 @@ parser.add_argument('-i', '--iteration', type=int,
|
|||
|
||||
args = parser.parse_args()
|
||||
|
||||
meshroom.core.initNodes()
|
||||
|
||||
graph = meshroom.core.graph.loadGraph(args.graphFile)
|
||||
if args.cache:
|
||||
graph.cacheDir = args.cache
|
||||
|
|
|
@ -22,4 +22,7 @@ parser.add_argument("--submitLabel",
|
|||
|
||||
args = parser.parse_args()
|
||||
|
||||
meshroom.core.initNodes()
|
||||
meshroom.core.initSubmitters()
|
||||
|
||||
meshroom.core.graph.submit(args.meshroomFile, args.submitter, toNode=args.toNode, submitLabel=args.submitLabel)
|
||||
|
|
|
@ -330,30 +330,32 @@ def loadPipelineTemplates(folder):
|
|||
if file.endswith(".mg") and file not in pipelineTemplates:
|
||||
pipelineTemplates[os.path.splitext(file)[0]] = os.path.join(folder, file)
|
||||
|
||||
meshroomFolder = os.path.dirname(os.path.dirname(__file__))
|
||||
def initNodes():
|
||||
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]
|
||||
nodesFolders = [os.path.join(meshroomFolder, 'nodes')] + additionalNodesPath
|
||||
for f in nodesFolders:
|
||||
loadAllNodes(folder=f)
|
||||
|
||||
additionalNodesPath = os.environ.get("MESHROOM_NODES_PATH", "").split(os.pathsep)
|
||||
# filter empty strings
|
||||
additionalNodesPath = [i for i in additionalNodesPath if i]
|
||||
def initSubmitters():
|
||||
meshroomFolder = os.path.dirname(os.path.dirname(__file__))
|
||||
subs = loadSubmitters(os.environ.get("MESHROOM_SUBMITTERS_PATH", meshroomFolder), 'submitters')
|
||||
for sub in subs:
|
||||
registerSubmitter(sub())
|
||||
|
||||
# Load plugins:
|
||||
# - Nodes
|
||||
nodesFolders = [os.path.join(meshroomFolder, 'nodes')] + additionalNodesPath
|
||||
def initPipelines():
|
||||
meshroomFolder = os.path.dirname(os.path.dirname(__file__))
|
||||
# Load pipeline templates: check in the default folder and any folder the user might have
|
||||
# added to the environment variable
|
||||
additionalPipelinesPath = os.environ.get("MESHROOM_PIPELINE_TEMPLATES_PATH", "").split(os.pathsep)
|
||||
additionalPipelinesPath = [i for i in additionalPipelinesPath if i]
|
||||
pipelineTemplatesFolders = [os.path.join(meshroomFolder, 'pipelines')] + additionalPipelinesPath
|
||||
for f in pipelineTemplatesFolders:
|
||||
loadPipelineTemplates(f)
|
||||
|
||||
for f in nodesFolders:
|
||||
loadAllNodes(folder=f)
|
||||
|
||||
# - Submitters
|
||||
subs = loadSubmitters(os.environ.get("MESHROOM_SUBMITTERS_PATH", meshroomFolder), 'submitters')
|
||||
|
||||
for sub in subs:
|
||||
registerSubmitter(sub())
|
||||
|
||||
# Load pipeline templates: check in the default folder and any folder the user might have
|
||||
# added to the environment variable
|
||||
additionalPipelinesPath = os.environ.get("MESHROOM_PIPELINE_TEMPLATES_PATH", "").split(os.pathsep)
|
||||
additionalPipelinesPath = [i for i in additionalPipelinesPath if i]
|
||||
pipelineTemplatesFolders = [os.path.join(meshroomFolder, 'pipelines')] + additionalPipelinesPath
|
||||
|
||||
for f in pipelineTemplatesFolders:
|
||||
loadPipelineTemplates(f)
|
||||
def initPlugins():
|
||||
initNodes()
|
||||
initSubmitters()
|
||||
initPipelines()
|
||||
|
|
|
@ -124,6 +124,8 @@ class MeshroomApp(QApplication):
|
|||
# - clean cache directory and make sure it exists on disk
|
||||
ThumbnailCache.initialize()
|
||||
|
||||
meshroom.core.initPlugins()
|
||||
|
||||
# QML engine setup
|
||||
qmlDir = os.path.join(pwd, "qml")
|
||||
url = os.path.join(qmlDir, "main.qml")
|
||||
|
|
Loading…
Add table
Reference in a new issue