From 52257695b23d49148608fc349c09feab2fe2a230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 26 Dec 2024 15:51:49 +0100 Subject: [PATCH 01/10] [core] Node: Add a `sourceCodeFolder` property This property stores the location of the source code for a given node and is not exposed to the QML side. --- meshroom/core/desc/node.py | 3 +++ meshroom/core/node.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/meshroom/core/desc/node.py b/meshroom/core/desc/node.py index b105d2f96a..9b46ca889f 100644 --- a/meshroom/core/desc/node.py +++ b/meshroom/core/desc/node.py @@ -1,3 +1,5 @@ +from inspect import getfile +from pathlib import Path import os import psutil import shlex @@ -63,6 +65,7 @@ class Node(object): def __init__(self): super(Node, self).__init__() self.hasDynamicOutputAttribute = any(output.isDynamicValue for output in self.outputs) + self.sourceCodeFolder = Path(getfile(self.__class__)).parent.resolve().as_posix() def upgradeAttributeValues(self, attrValues, fromVersion): return attrValues diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 1b8806e2e4..309d5d7cdb 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -501,6 +501,7 @@ def __init__(self, nodeType, position=None, parent=None, uid=None, **kwargs): self.packageName = self.packageVersion = "" self._internalFolder = "" + self._sourceCodeFolder = "" self._name = None self.graph = None @@ -1039,6 +1040,10 @@ def updateInternalAttributes(self): def internalFolder(self): return self._internalFolder.format(**self._cmdVars) + @property + def sourceCodeFolder(self): + return self._sourceCodeFolder + def updateStatusFromCache(self): """ Update node status based on status file content/existence. @@ -1441,6 +1446,7 @@ def __init__(self, nodeType, position=None, parent=None, uid=None, **kwargs): self.packageName = self.nodeDesc.packageName self.packageVersion = self.nodeDesc.packageVersion self._internalFolder = self.nodeDesc.internalFolder + self._sourceCodeFolder = self.nodeDesc.sourceCodeFolder for attrDesc in self.nodeDesc.inputs: self._attributes.add(attributeFactory(attrDesc, kwargs.get(attrDesc.name, None), isOutput=False, node=self)) From 5f48bdccc4343e23609851e902f20674ae7ce5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 8 Jan 2025 18:20:59 +0100 Subject: [PATCH 02/10] [core] Add default relative paths to the command line variables Add 2 default entries to the command line variables: - `nodeCacheFolder`, which contains the location of the cache folder - `nodeSourceCodeFolder`, which contains the location of the file describing the node --- meshroom/core/attribute.py | 9 ++++++++- meshroom/core/node.py | 10 +++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/meshroom/core/attribute.py b/meshroom/core/attribute.py index dd69db1251..3f9c2f69f9 100644 --- a/meshroom/core/attribute.py +++ b/meshroom/core/attribute.py @@ -350,7 +350,14 @@ def getEvalValue(self): Return the value. If it is a string, expressions will be evaluated. ''' if isinstance(self.value, str): - return Template(self.value).safe_substitute(os.environ) + substituted = Template(self.value).safe_substitute(os.environ) + try: + varResolved = substituted.format(**self.node._cmdVars) + return varResolved + except KeyError: + # Catch KeyErrors to be able to open files created prior to the support of relative variables + # (when self.node._cmdVars was not used to evaluate expressions in the attribute) + return substituted return self.value def getValueStr(self, withQuotes=True): diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 309d5d7cdb..0d45774ddc 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -758,6 +758,8 @@ def _buildAttributeCmdVars(cmdVars, name, attr): """ Generate command variables using input attributes and resolved output attributes names and values. """ self._cmdVars["uid"] = self._uid + self._cmdVars["nodeCacheFolder"] = self.internalFolder + self._cmdVars["nodeSourceCodeFolder"] = self.sourceCodeFolder # Evaluate input params for name, attr in self._attributes.objects.items(): @@ -1022,8 +1024,10 @@ def updateInternals(self, cacheDir=None): # Update command variables / output attributes self._cmdVars = { - 'cache': cacheDir or self.graph.cacheDir, - 'nodeType': self.nodeType, + "cache": cacheDir or self.graph.cacheDir, + "nodeType": self.nodeType, + "nodeCacheFolder": self._internalFolder, + "nodeSourceCodeFolder": self.sourceCodeFolder } self._computeUid() self._buildCmdVars() @@ -1445,7 +1449,7 @@ def __init__(self, nodeType, position=None, parent=None, uid=None, **kwargs): self.packageName = self.nodeDesc.packageName self.packageVersion = self.nodeDesc.packageVersion - self._internalFolder = self.nodeDesc.internalFolder + self._internalFolder = "{cache}/{nodeType}/{uid}" self._sourceCodeFolder = self.nodeDesc.sourceCodeFolder for attrDesc in self.nodeDesc.inputs: From af1cda0c916eb40f19ed082fd12e0a77634331ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 8 Jan 2025 18:59:49 +0100 Subject: [PATCH 03/10] [nodes] Replace `desc.Node.internalFolder` with `{nodeCacheFolder}` --- meshroom/nodes/aliceVision/ApplyCalibration.py | 2 +- meshroom/nodes/aliceVision/CameraCalibration.py | 2 +- meshroom/nodes/aliceVision/CameraInit.py | 2 +- meshroom/nodes/aliceVision/CameraLocalization.py | 4 ++-- .../nodes/aliceVision/CameraRigCalibration.py | 2 +- .../nodes/aliceVision/CameraRigLocalization.py | 2 +- .../nodes/aliceVision/CheckerboardCalibration.py | 2 +- .../nodes/aliceVision/CheckerboardDetection.py | 4 ++-- .../nodes/aliceVision/ColorCheckerCorrection.py | 4 ++-- .../nodes/aliceVision/ColorCheckerDetection.py | 2 +- meshroom/nodes/aliceVision/ConvertDistortion.py | 2 +- meshroom/nodes/aliceVision/ConvertMesh.py | 2 +- meshroom/nodes/aliceVision/ConvertSfMFormat.py | 2 +- meshroom/nodes/aliceVision/DepthMap.py | 14 +++++++------- meshroom/nodes/aliceVision/DepthMapFilter.py | 8 ++++---- meshroom/nodes/aliceVision/DepthMapRendering.py | 6 +++--- .../nodes/aliceVision/DistortionCalibration.py | 2 +- .../nodes/aliceVision/ExportAnimatedCamera.py | 8 ++++---- .../nodes/aliceVision/ExportColoredPointCloud.py | 2 +- meshroom/nodes/aliceVision/ExportDistortion.py | 10 +++++----- meshroom/nodes/aliceVision/ExportMatches.py | 2 +- meshroom/nodes/aliceVision/ExportMaya.py | 2 +- meshroom/nodes/aliceVision/FeatureExtraction.py | 2 +- meshroom/nodes/aliceVision/FeatureMatching.py | 2 +- .../nodes/aliceVision/FeatureRepeatability.py | 2 +- .../aliceVision/GlobalRotationEstimating.py | 2 +- meshroom/nodes/aliceVision/GlobalSfM.py | 6 +++--- meshroom/nodes/aliceVision/ImageMasking.py | 2 +- meshroom/nodes/aliceVision/ImageMatching.py | 2 +- .../nodes/aliceVision/ImageMatchingMultiSfM.py | 4 ++-- meshroom/nodes/aliceVision/ImageProcessing.py | 12 ++++++------ meshroom/nodes/aliceVision/ImageSegmentation.py | 4 ++-- meshroom/nodes/aliceVision/ImportE57.py | 2 +- meshroom/nodes/aliceVision/ImportKnownPoses.py | 2 +- meshroom/nodes/aliceVision/KeyframeSelection.py | 6 +++--- .../nodes/aliceVision/LdrToHdrCalibration.py | 4 ++-- meshroom/nodes/aliceVision/LdrToHdrMerge.py | 4 ++-- meshroom/nodes/aliceVision/LdrToHdrSampling.py | 2 +- meshroom/nodes/aliceVision/LidarDecimating.py | 4 ++-- meshroom/nodes/aliceVision/LidarMerging.py | 2 +- meshroom/nodes/aliceVision/LidarMeshing.py | 4 ++-- .../nodes/aliceVision/LightingCalibration.py | 4 ++-- meshroom/nodes/aliceVision/LightingEstimation.py | 2 +- meshroom/nodes/aliceVision/MergeMeshes.py | 2 +- meshroom/nodes/aliceVision/MeshDecimate.py | 2 +- meshroom/nodes/aliceVision/MeshDenoising.py | 2 +- meshroom/nodes/aliceVision/MeshFiltering.py | 2 +- meshroom/nodes/aliceVision/MeshMasking.py | 2 +- .../nodes/aliceVision/MeshRemoveUnseenFaces.py | 2 +- meshroom/nodes/aliceVision/MeshResampling.py | 2 +- meshroom/nodes/aliceVision/Meshing.py | 4 ++-- meshroom/nodes/aliceVision/NodalSfM.py | 2 +- meshroom/nodes/aliceVision/NormalIntegration.py | 2 +- meshroom/nodes/aliceVision/NormalMapRendering.py | 4 ++-- .../nodes/aliceVision/PanoramaCompositing.py | 2 +- meshroom/nodes/aliceVision/PanoramaEstimation.py | 4 ++-- meshroom/nodes/aliceVision/PanoramaInit.py | 4 ++-- meshroom/nodes/aliceVision/PanoramaMerging.py | 2 +- .../nodes/aliceVision/PanoramaPostProcessing.py | 6 +++--- .../nodes/aliceVision/PanoramaPrepareImages.py | 2 +- meshroom/nodes/aliceVision/PanoramaSeams.py | 4 ++-- meshroom/nodes/aliceVision/PanoramaWarping.py | 2 +- meshroom/nodes/aliceVision/PhotometricStereo.py | 16 ++++++++-------- meshroom/nodes/aliceVision/PrepareDenseScene.py | 4 ++-- .../nodes/aliceVision/RelativePoseEstimating.py | 2 +- .../nodes/aliceVision/SelectConnectedViews.py | 2 +- meshroom/nodes/aliceVision/SfMAlignment.py | 4 ++-- meshroom/nodes/aliceVision/SfMChecking.py | 2 +- meshroom/nodes/aliceVision/SfMColorizing.py | 2 +- meshroom/nodes/aliceVision/SfMFilter.py | 4 ++-- meshroom/nodes/aliceVision/SfMMerge.py | 2 +- meshroom/nodes/aliceVision/SfMPoseInjecting.py | 2 +- .../nodes/aliceVision/SfMSplitReconstructed.py | 4 ++-- meshroom/nodes/aliceVision/SfMToRig.py | 2 +- meshroom/nodes/aliceVision/SfMTransfer.py | 4 ++-- meshroom/nodes/aliceVision/SfMTransform.py | 4 ++-- meshroom/nodes/aliceVision/SfMTriangulation.py | 4 ++-- meshroom/nodes/aliceVision/SfmBootstraping.py | 2 +- meshroom/nodes/aliceVision/SfmExpanding.py | 2 +- meshroom/nodes/aliceVision/SphereDetection.py | 2 +- meshroom/nodes/aliceVision/Split360Images.py | 4 ++-- .../nodes/aliceVision/StructureFromMotion.py | 6 +++--- meshroom/nodes/aliceVision/Texturing.py | 14 +++++++------- meshroom/nodes/aliceVision/TracksBuilding.py | 2 +- meshroom/nodes/blender/ScenePreview.py | 4 ++-- 85 files changed, 153 insertions(+), 153 deletions(-) diff --git a/meshroom/nodes/aliceVision/ApplyCalibration.py b/meshroom/nodes/aliceVision/ApplyCalibration.py index 34862871e1..a90c98100c 100644 --- a/meshroom/nodes/aliceVision/ApplyCalibration.py +++ b/meshroom/nodes/aliceVision/ApplyCalibration.py @@ -44,6 +44,6 @@ class ApplyCalibration(desc.AVCommandLineNode): name="output", label="SMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/CameraCalibration.py b/meshroom/nodes/aliceVision/CameraCalibration.py index 01293a0408..3cbb637b43 100644 --- a/meshroom/nodes/aliceVision/CameraCalibration.py +++ b/meshroom/nodes/aliceVision/CameraCalibration.py @@ -124,6 +124,6 @@ class CameraCalibration(desc.AVCommandLineNode): name="output", label="Output", description="Output filename for intrinsic [and extrinsic] parameters.", - value=desc.Node.internalFolder + "/cameraCalibration.cal", + value="{nodeCacheFolder}/cameraCalibration.cal", ), ] diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index 43915693c6..227d9e1669 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -486,7 +486,7 @@ class CameraInit(desc.AVCommandLineNode, desc.InitNode): name="output", label="SfMData", description="Output SfMData.", - value=desc.Node.internalFolder + "cameraInit.sfm", + value="{nodeCacheFolder}/cameraInit.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/CameraLocalization.py b/meshroom/nodes/aliceVision/CameraLocalization.py index 8f00e7c318..a778fda9c5 100644 --- a/meshroom/nodes/aliceVision/CameraLocalization.py +++ b/meshroom/nodes/aliceVision/CameraLocalization.py @@ -191,12 +191,12 @@ class CameraLocalization(desc.AVCommandLineNode): name="outputAlembic", label="Alembic", description="Filename for the SfMData export file (where camera poses will be stored).", - value=desc.Node.internalFolder + "trackedCameras.abc", + value="{nodeCacheFolder}/trackedCameras.abc", ), desc.File( name="outputJSON", label="JSON File", description="Filename for the localization results as .json.", - value=desc.Node.internalFolder + "trackedCameras.json", + value="{nodeCacheFolder}/trackedCameras.json", ), ] diff --git a/meshroom/nodes/aliceVision/CameraRigCalibration.py b/meshroom/nodes/aliceVision/CameraRigCalibration.py index ba6a791e26..f788134280 100644 --- a/meshroom/nodes/aliceVision/CameraRigCalibration.py +++ b/meshroom/nodes/aliceVision/CameraRigCalibration.py @@ -156,6 +156,6 @@ class CameraRigCalibration(desc.AVCommandLineNode): name="outfile", label="Output File", description="The name of the file to store the calibration data in.", - value=desc.Node.internalFolder + "cameraRigCalibration.rigCal", + value="{nodeCacheFolder}/cameraRigCalibration.rigCal", ), ] diff --git a/meshroom/nodes/aliceVision/CameraRigLocalization.py b/meshroom/nodes/aliceVision/CameraRigLocalization.py index c1fed08e30..331c171052 100644 --- a/meshroom/nodes/aliceVision/CameraRigLocalization.py +++ b/meshroom/nodes/aliceVision/CameraRigLocalization.py @@ -162,6 +162,6 @@ class CameraRigLocalization(desc.AVCommandLineNode): name="outputAlembic", label="Alembic", description="Filename for the SfMData export file (where camera poses will be stored).", - value=desc.Node.internalFolder + "trackedcameras.abc", + value="{nodeCacheFolder}/trackedcameras.abc", ), ] diff --git a/meshroom/nodes/aliceVision/CheckerboardCalibration.py b/meshroom/nodes/aliceVision/CheckerboardCalibration.py index f07f9ec8ee..1cdc8229bd 100644 --- a/meshroom/nodes/aliceVision/CheckerboardCalibration.py +++ b/meshroom/nodes/aliceVision/CheckerboardCalibration.py @@ -47,6 +47,6 @@ class CheckerboardCalibration(desc.AVCommandLineNode): name="output", label="SfMData File", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ) ] diff --git a/meshroom/nodes/aliceVision/CheckerboardDetection.py b/meshroom/nodes/aliceVision/CheckerboardDetection.py index baa6b0a3c9..6d48ba31a5 100644 --- a/meshroom/nodes/aliceVision/CheckerboardDetection.py +++ b/meshroom/nodes/aliceVision/CheckerboardDetection.py @@ -61,7 +61,7 @@ class CheckerboardDetection(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="checkerLines", @@ -69,7 +69,7 @@ class CheckerboardDetection(desc.AVCommandLineNode): label="Checker Lines", description="Debug images.", semantic="image", - value=desc.Node.internalFolder + ".png", + value="{nodeCacheFolder}/.png", group="", # do not export on the command line ), ] diff --git a/meshroom/nodes/aliceVision/ColorCheckerCorrection.py b/meshroom/nodes/aliceVision/ColorCheckerCorrection.py index a301298210..007ec4bb5c 100644 --- a/meshroom/nodes/aliceVision/ColorCheckerCorrection.py +++ b/meshroom/nodes/aliceVision/ColorCheckerCorrection.py @@ -69,13 +69,13 @@ class ColorCheckerCorrection(desc.AVCommandLineNode): name="outSfMData", label="SfMData", description="Output SfMData.", - value=lambda attr: (desc.Node.internalFolder + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in [".abc", ".sfm"]) else "", + value=lambda attr: ("{nodeCacheFolder}/" + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in [".abc", ".sfm"]) else "", group="", # do not export on the command line ), desc.File( name="output", label="Folder", description="Output images folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/ColorCheckerDetection.py b/meshroom/nodes/aliceVision/ColorCheckerDetection.py index c92b64443e..ae8286615c 100644 --- a/meshroom/nodes/aliceVision/ColorCheckerDetection.py +++ b/meshroom/nodes/aliceVision/ColorCheckerDetection.py @@ -62,6 +62,6 @@ class ColorCheckerDetection(desc.AVCommandLineNode): name="outputData", label="Color Checker Data", description="Output position and colorimetric data extracted from detected color checkers in the images.", - value=desc.Node.internalFolder + "/ccheckers.json", + value="{nodeCacheFolder}/ccheckers.json", ), ] diff --git a/meshroom/nodes/aliceVision/ConvertDistortion.py b/meshroom/nodes/aliceVision/ConvertDistortion.py index d196d246a5..19094c05b8 100644 --- a/meshroom/nodes/aliceVision/ConvertDistortion.py +++ b/meshroom/nodes/aliceVision/ConvertDistortion.py @@ -48,6 +48,6 @@ class ConvertDistortion(desc.AVCommandLineNode): name="output", label="Output", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), ] diff --git a/meshroom/nodes/aliceVision/ConvertMesh.py b/meshroom/nodes/aliceVision/ConvertMesh.py index 035bfa2867..27b3d64c1c 100644 --- a/meshroom/nodes/aliceVision/ConvertMesh.py +++ b/meshroom/nodes/aliceVision/ConvertMesh.py @@ -39,6 +39,6 @@ class ConvertMesh(desc.AVCommandLineNode): name="output", label="Mesh", description="Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).", - value=desc.Node.internalFolder + "mesh." + "{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}", ), ] diff --git a/meshroom/nodes/aliceVision/ConvertSfMFormat.py b/meshroom/nodes/aliceVision/ConvertSfMFormat.py index b98235235e..9f10a327d7 100644 --- a/meshroom/nodes/aliceVision/ConvertSfMFormat.py +++ b/meshroom/nodes/aliceVision/ConvertSfMFormat.py @@ -94,6 +94,6 @@ class ConvertSfMFormat(desc.AVCommandLineNode): name="output", label="Output", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.{fileExtValue}", + value="{nodeCacheFolder}/sfm.{fileExtValue}", ), ] diff --git a/meshroom/nodes/aliceVision/DepthMap.py b/meshroom/nodes/aliceVision/DepthMap.py index 469f90c867..bd391af037 100644 --- a/meshroom/nodes/aliceVision/DepthMap.py +++ b/meshroom/nodes/aliceVision/DepthMap.py @@ -565,7 +565,7 @@ class DepthMap(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder for generated depth maps.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), # these attributes are only here to describe more accurately the output of the node # by specifying that it generates 2 sequences of images @@ -575,7 +575,7 @@ class DepthMap(desc.AVCommandLineNode): label="Depth Maps", description="Generated depth maps.", semantic="image", - value=desc.Node.internalFolder + "_depthMap.exr", + value="{nodeCacheFolder}/_depthMap.exr", group="", # do not export on the command line ), desc.File( @@ -583,14 +583,14 @@ class DepthMap(desc.AVCommandLineNode): label="Sim Maps", description="Generated sim maps.", semantic="image", - value=desc.Node.internalFolder + "_simMap.exr", + value="{nodeCacheFolder}/_simMap.exr", group="", # do not export on the command line ), desc.File( name="tilePattern", label="Tile Pattern", description="Debug: Tile pattern.", - value=desc.Node.internalFolder + "_tilePattern.obj", + value="{nodeCacheFolder}/_tilePattern.obj", group="", # do not export on the command line enabled=lambda node: node.intermediateResults.exportTilePattern.value, ), @@ -599,7 +599,7 @@ class DepthMap(desc.AVCommandLineNode): label="Depth Maps SGM", description="Debug: Depth maps SGM", semantic="image", - value=desc.Node.internalFolder + "_depthMap_sgm.exr", + value="{nodeCacheFolder}/_depthMap_sgm.exr", group="", # do not export on the command line enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), @@ -608,7 +608,7 @@ class DepthMap(desc.AVCommandLineNode): label="Depth Maps SGM Upscaled", description="Debug: Depth maps SGM upscaled.", semantic="image", - value=desc.Node.internalFolder + "_depthMap_sgmUpscaled.exr", + value="{nodeCacheFolder}/_depthMap_sgmUpscaled.exr", group="", # do not export on the command line enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), @@ -617,7 +617,7 @@ class DepthMap(desc.AVCommandLineNode): label="Depth Maps Refined", description="Debug: Depth maps after refinement", semantic="image", - value=desc.Node.internalFolder + "_depthMap_refinedFused.exr", + value="{nodeCacheFolder}/_depthMap_refinedFused.exr", group="", # do not export on the command line enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), diff --git a/meshroom/nodes/aliceVision/DepthMapFilter.py b/meshroom/nodes/aliceVision/DepthMapFilter.py index a760b089e1..701708cf98 100644 --- a/meshroom/nodes/aliceVision/DepthMapFilter.py +++ b/meshroom/nodes/aliceVision/DepthMapFilter.py @@ -113,7 +113,7 @@ class DepthMapFilter(desc.AVCommandLineNode): name="output", label="Filtered Depth Maps Folder", description="Output folder for generated depth maps.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}" ), # these attributes are only here to describe more accurately the output of the node # by specifying that it generates 2 sequences of images @@ -123,7 +123,7 @@ class DepthMapFilter(desc.AVCommandLineNode): label="Depth Maps", description="Filtered depth maps.", semantic="image", - value=desc.Node.internalFolder + "_depthMap.exr", + value="{nodeCacheFolder}/_depthMap.exr", group="", # do not export on the command line ), desc.File( @@ -131,7 +131,7 @@ class DepthMapFilter(desc.AVCommandLineNode): label="Sim Maps", description="Filtered sim maps.", semantic="image", - value=desc.Node.internalFolder + "_simMap.exr", + value="{nodeCacheFolder}/_simMap.exr", group="", # do not export on the command line ), desc.File( @@ -139,7 +139,7 @@ class DepthMapFilter(desc.AVCommandLineNode): label="Normal Maps", description="Normal maps.", semantic="image", - value=desc.Node.internalFolder + "_normalMap.exr", + value="{nodeCacheFolder}/_normalMap.exr", enabled=lambda node: node.computeNormalMaps.value, group="", # do not export on the command line ), diff --git a/meshroom/nodes/aliceVision/DepthMapRendering.py b/meshroom/nodes/aliceVision/DepthMapRendering.py index 508550b739..fa071c0489 100644 --- a/meshroom/nodes/aliceVision/DepthMapRendering.py +++ b/meshroom/nodes/aliceVision/DepthMapRendering.py @@ -39,14 +39,14 @@ class DepthMapRendering(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="depth", label="Depth Maps", description="Rendered depth maps.", semantic="image", - value=desc.Node.internalFolder + "_depthMap.exr", + value="{nodeCacheFolder}/_depthMap.exr", group="", # do not export on the command line ), desc.File( @@ -54,7 +54,7 @@ class DepthMapRendering(desc.AVCommandLineNode): label="Masks", description="Masks.", semantic="image", - value=desc.Node.internalFolder + "_mask.exr", + value="{nodeCacheFolder}/_mask.exr", group="", # do not export on the command line ), ] diff --git a/meshroom/nodes/aliceVision/DistortionCalibration.py b/meshroom/nodes/aliceVision/DistortionCalibration.py index ce3632f2ab..8276ace659 100644 --- a/meshroom/nodes/aliceVision/DistortionCalibration.py +++ b/meshroom/nodes/aliceVision/DistortionCalibration.py @@ -59,6 +59,6 @@ class DistortionCalibration(desc.AVCommandLineNode): name="output", label="SfMData File", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/ExportAnimatedCamera.py b/meshroom/nodes/aliceVision/ExportAnimatedCamera.py index 8dcc995e6d..50ca8d0996 100644 --- a/meshroom/nodes/aliceVision/ExportAnimatedCamera.py +++ b/meshroom/nodes/aliceVision/ExportAnimatedCamera.py @@ -83,27 +83,27 @@ class ExportAnimatedCamera(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder with animated camera and undistorted images.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputCamera", label="Camera", description="Output filename for the animated camera in Alembic format.", - value=desc.Node.internalFolder + "camera.abc", + value="{nodeCacheFolder}/camera.abc", group="", # exclude from command line ), desc.File( name="outputUndistorted", label="Undistorted Folder", description="Output undistorted folder.", - value=desc.Node.internalFolder + "undistort/", + value="{nodeCacheFolder}/undistort/", group="", # exclude from command line ), desc.File( name="outputImages", label="Undistorted Images", description="Output undistorted images.", - value=desc.Node.internalFolder + "undistort/" + "_.{undistortedImageTypeValue}", + value="{nodeCacheFolder}/undistort/_.{undistortedImageTypeValue}", semantic="image", group="", # exclude from command line enabled=lambda node: node.exportUndistortedImages.value, diff --git a/meshroom/nodes/aliceVision/ExportColoredPointCloud.py b/meshroom/nodes/aliceVision/ExportColoredPointCloud.py index 0e4a6c1e3b..9ffa194fbe 100644 --- a/meshroom/nodes/aliceVision/ExportColoredPointCloud.py +++ b/meshroom/nodes/aliceVision/ExportColoredPointCloud.py @@ -32,6 +32,6 @@ class ExportColoredPointCloud(desc.AVCommandLineNode): name="output", label="Point Cloud Filepath", description="Output point cloud with visibilities as SfMData file.", - value=desc.Node.internalFolder + "pointCloud.abc", + value="{nodeCacheFolder}/pointCloud.abc", ), ] diff --git a/meshroom/nodes/aliceVision/ExportDistortion.py b/meshroom/nodes/aliceVision/ExportDistortion.py index e350e759df..902b865d01 100644 --- a/meshroom/nodes/aliceVision/ExportDistortion.py +++ b/meshroom/nodes/aliceVision/ExportDistortion.py @@ -59,13 +59,13 @@ class ExportDistortion(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="distortionNukeNode", label="Distortion Nuke Node", description="Calibrated distortion ST map.", - value=desc.Node.internalFolder + "nukeLensDistortion_.nk", + value="{nodeCacheFolder}/nukeLensDistortion_.nk", group="", # do not export on the command line enabled=lambda node: node.exportNukeNode.value, ), @@ -74,7 +74,7 @@ class ExportDistortion(desc.AVCommandLineNode): label="Undistorted Lens Grids", description="Undistorted lens grids for validation", semantic="image", - value=desc.Node.internalFolder + "lensgrid__undistort.exr", + value="{nodeCacheFolder}/lensgrid__undistort.exr", group="", # do not export on the command line enabled=lambda node: node.exportLensGridsUndistorted.value, ), @@ -83,7 +83,7 @@ class ExportDistortion(desc.AVCommandLineNode): label="Distortion ST Map", description="Calibrated distortion ST map.", semantic="image", - value=desc.Node.internalFolder + "stmap__distort.exr", + value="{nodeCacheFolder}/stmap__distort.exr", group="", # do not export on the command line enabled=lambda node: node.exportSTMaps.value, ), @@ -92,7 +92,7 @@ class ExportDistortion(desc.AVCommandLineNode): label="Undistortion ST Map", description="Calibrated undistortion ST map.", semantic="image", - value=desc.Node.internalFolder + "stmap__undistort.exr", + value="{nodeCacheFolder}/stmap__undistort.exr", group="", # do not export on the command line enabled=lambda node: node.exportSTMaps.value, ), diff --git a/meshroom/nodes/aliceVision/ExportMatches.py b/meshroom/nodes/aliceVision/ExportMatches.py index 7e1b7d93d6..f60d396aa9 100644 --- a/meshroom/nodes/aliceVision/ExportMatches.py +++ b/meshroom/nodes/aliceVision/ExportMatches.py @@ -64,6 +64,6 @@ class ExportMatches(desc.AVCommandLineNode): name="output", label="Folder", description="Output path for the features and descriptors files (*.feat, *.desc).", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/ExportMaya.py b/meshroom/nodes/aliceVision/ExportMaya.py index d87b6da02f..d5d62a60f4 100644 --- a/meshroom/nodes/aliceVision/ExportMaya.py +++ b/meshroom/nodes/aliceVision/ExportMaya.py @@ -36,6 +36,6 @@ class ExportMaya(desc.AVCommandLineNode): name="output", label="Folder", description="Folder for MeshroomMaya outputs: undistorted images and thumbnails.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/FeatureExtraction.py b/meshroom/nodes/aliceVision/FeatureExtraction.py index 961a2b9e32..5f1cce6e50 100644 --- a/meshroom/nodes/aliceVision/FeatureExtraction.py +++ b/meshroom/nodes/aliceVision/FeatureExtraction.py @@ -160,6 +160,6 @@ class FeatureExtraction(desc.AVCommandLineNode): name="output", label="Features Folder", description="Output path for the features and descriptors files (*.feat, *.desc).", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/FeatureMatching.py b/meshroom/nodes/aliceVision/FeatureMatching.py index 4d209e314b..a8bc0e19a4 100644 --- a/meshroom/nodes/aliceVision/FeatureMatching.py +++ b/meshroom/nodes/aliceVision/FeatureMatching.py @@ -205,6 +205,6 @@ class FeatureMatching(desc.AVCommandLineNode): name="output", label="Matches Folder", description="Path to a folder in which the computed matches are stored.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/FeatureRepeatability.py b/meshroom/nodes/aliceVision/FeatureRepeatability.py index 21778d55b8..a57ac67735 100644 --- a/meshroom/nodes/aliceVision/FeatureRepeatability.py +++ b/meshroom/nodes/aliceVision/FeatureRepeatability.py @@ -115,6 +115,6 @@ class FeatureRepeatability(desc.AVCommandLineNode): name="output", label="Folder", description="Output path for the features and descriptors files (*.feat, *.desc).", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/GlobalRotationEstimating.py b/meshroom/nodes/aliceVision/GlobalRotationEstimating.py index 165ac1279c..2b2235c1b7 100644 --- a/meshroom/nodes/aliceVision/GlobalRotationEstimating.py +++ b/meshroom/nodes/aliceVision/GlobalRotationEstimating.py @@ -61,6 +61,6 @@ class GlobalRotationEstimating(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), ] diff --git a/meshroom/nodes/aliceVision/GlobalSfM.py b/meshroom/nodes/aliceVision/GlobalSfM.py index 8cb319f860..94521f2bb8 100644 --- a/meshroom/nodes/aliceVision/GlobalSfM.py +++ b/meshroom/nodes/aliceVision/GlobalSfM.py @@ -94,18 +94,18 @@ class GlobalSfM(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), desc.File( name="outputViewsAndPoses", label="Output Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), desc.File( name="extraInfoFolder", label="Folder", description="Folder for intermediate reconstruction files and additional reconstruction information files.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/ImageMasking.py b/meshroom/nodes/aliceVision/ImageMasking.py index 60576f7303..e2e1c10b8e 100644 --- a/meshroom/nodes/aliceVision/ImageMasking.py +++ b/meshroom/nodes/aliceVision/ImageMasking.py @@ -131,6 +131,6 @@ class ImageMasking(desc.AVCommandLineNode): name="output", label="Output", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/ImageMatching.py b/meshroom/nodes/aliceVision/ImageMatching.py index 2cc71c6bd0..4fea8330f3 100644 --- a/meshroom/nodes/aliceVision/ImageMatching.py +++ b/meshroom/nodes/aliceVision/ImageMatching.py @@ -135,6 +135,6 @@ class ImageMatching(desc.AVCommandLineNode): name="output", label="Image Pairs", description="Filepath to the output file with the list of selected image pairs.", - value=desc.Node.internalFolder + "imageMatches.txt", + value="{nodeCacheFolder}/imageMatches.txt", ), ] diff --git a/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py b/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py index 211efff1c9..097bf8a501 100644 --- a/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py +++ b/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py @@ -141,12 +141,12 @@ class ImageMatchingMultiSfM(desc.AVCommandLineNode): name="output", label="List File", description="Filepath to the output file with the list of selected image pairs.", - value=desc.Node.internalFolder + "imageMatches.txt", + value="{nodeCacheFolder}/imageMatches.txt", ), desc.File( name="outputCombinedSfM", label="Combined SfM", description="Path for the combined SfMData file.", - value=desc.Node.internalFolder + "combineSfM.sfm", + value="{nodeCacheFolder}/combineSfM.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/ImageProcessing.py b/meshroom/nodes/aliceVision/ImageProcessing.py index be8e6fecb5..1aa76d105b 100644 --- a/meshroom/nodes/aliceVision/ImageProcessing.py +++ b/meshroom/nodes/aliceVision/ImageProcessing.py @@ -15,20 +15,20 @@ def outputImagesValueFunct(attr): if inputExt in ['.abc', '.sfm']: fileStem = '' if attr.node.keepImageFilename.value else '' # If we have an SfM in input - return desc.Node.internalFolder + fileStem + (outputExt or '.*') + return "{nodeCacheFolder}/" + fileStem + (outputExt or '.*') if inputExt: # If we have one or multiple files in input - return desc.Node.internalFolder + fileStem + (outputExt or inputExt) + return "{nodeCacheFolder}/" + fileStem + (outputExt or inputExt) if '*' in fileStem: # The fileStem of the input param is a regular expression, # so even if there is no file extension, # we consider that the expression represents files. - return desc.Node.internalFolder + fileStem + (outputExt or '.*') + return "{nodeCacheFolder}/" + fileStem + (outputExt or '.*') # No extension and no expression means that the input param is a folder path - return desc.Node.internalFolder + '*' + (outputExt or '.*') + return "{nodeCacheFolder}/" + '*' + (outputExt or '.*') class ImageProcessing(desc.AVCommandLineNode): @@ -608,14 +608,14 @@ class ImageProcessing(desc.AVCommandLineNode): name="outSfMData", label="SfMData", description="Output SfMData file.", - value=lambda attr: (desc.Node.internalFolder + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in [".abc", ".sfm"]) else "", + value=lambda attr: ("{nodeCacheFolder}/" + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in [".abc", ".sfm"]) else "", group="", # do not export on the command line ), desc.File( name="output", label="Folder", description="Output images folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputImages", diff --git a/meshroom/nodes/aliceVision/ImageSegmentation.py b/meshroom/nodes/aliceVision/ImageSegmentation.py index 1f2df77b19..889d931d8d 100644 --- a/meshroom/nodes/aliceVision/ImageSegmentation.py +++ b/meshroom/nodes/aliceVision/ImageSegmentation.py @@ -81,14 +81,14 @@ class ImageSegmentation(desc.AVCommandLineNode): name="output", label="Masks Folder", description="Output path for the masks.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="masks", label="Masks", description="Generated segmentation masks.", semantic="image", - value=lambda attr: desc.Node.internalFolder + ".exr" if not attr.node.keepFilename.value else desc.Node.internalFolder + ".exr", + value=lambda attr: "{nodeCacheFolder}/.exr" if not attr.node.keepFilename.value else "{nodeCacheFolder}/.exr", group="", ), ] diff --git a/meshroom/nodes/aliceVision/ImportE57.py b/meshroom/nodes/aliceVision/ImportE57.py index db621f769a..ef1ac204ff 100644 --- a/meshroom/nodes/aliceVision/ImportE57.py +++ b/meshroom/nodes/aliceVision/ImportE57.py @@ -60,6 +60,6 @@ class ImportE57(desc.AVCommandLineNode): name="output", label="Output", description="Path to the output JSON file.", - value=desc.Node.internalFolder + "inputset.json", + value="{nodeCacheFolder}/inputset.json", ), ] diff --git a/meshroom/nodes/aliceVision/ImportKnownPoses.py b/meshroom/nodes/aliceVision/ImportKnownPoses.py index 90237527dc..0a7e5e9866 100644 --- a/meshroom/nodes/aliceVision/ImportKnownPoses.py +++ b/meshroom/nodes/aliceVision/ImportKnownPoses.py @@ -39,6 +39,6 @@ class ImportKnownPoses(desc.AVCommandLineNode): name="output", label="Output", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "/sfmData.abc", + value="{nodeCacheFolder}/sfmData.abc", ), ] diff --git a/meshroom/nodes/aliceVision/KeyframeSelection.py b/meshroom/nodes/aliceVision/KeyframeSelection.py index ff52217847..6fb405774d 100644 --- a/meshroom/nodes/aliceVision/KeyframeSelection.py +++ b/meshroom/nodes/aliceVision/KeyframeSelection.py @@ -390,20 +390,20 @@ class KeyframeSelection(desc.AVCommandLineNode): name="outputFolder", label="Folder", description="Output keyframes folder for extracted frames.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputSfMDataKeyframes", label="Keyframes SfMData", description="Output SfMData file containing all the selected keyframes.", - value=desc.Node.internalFolder + "keyframes.sfm", + value="{nodeCacheFolder}/keyframes.sfm", ), desc.File( name="outputSfMDataFrames", label="Frames SfMData", description="Output SfMData file containing all the frames that were not selected as keyframes.\n" "If the input contains videos, this file will not be written since all the frames that were not selected do not actually exist on disk.", - value=desc.Node.internalFolder + "frames.sfm", + value="{nodeCacheFolder}/frames.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/LdrToHdrCalibration.py b/meshroom/nodes/aliceVision/LdrToHdrCalibration.py index e600656ccb..30002ebe97 100644 --- a/meshroom/nodes/aliceVision/LdrToHdrCalibration.py +++ b/meshroom/nodes/aliceVision/LdrToHdrCalibration.py @@ -46,7 +46,7 @@ class LdrToHdrCalibration(desc.AVCommandLineNode): name="samples", label="Samples Folder", description="Samples folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.IntParam( name="userNbBrackets", @@ -151,7 +151,7 @@ class LdrToHdrCalibration(desc.AVCommandLineNode): name="response", label="Response File", description="Path to the output response file.", - value=desc.Node.internalFolder + "response_.csv", + value="{nodeCacheFolder}/response_.csv", ), ] diff --git a/meshroom/nodes/aliceVision/LdrToHdrMerge.py b/meshroom/nodes/aliceVision/LdrToHdrMerge.py index e4c31de0f6..ba71e0e21b 100644 --- a/meshroom/nodes/aliceVision/LdrToHdrMerge.py +++ b/meshroom/nodes/aliceVision/LdrToHdrMerge.py @@ -228,14 +228,14 @@ class LdrToHdrMerge(desc.AVCommandLineNode): name="outputFolder", label="Folder", description="Path to the folder containing the merged HDR images.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", group="", # do not export on the command line ), desc.File( name="outSfMData", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/LdrToHdrSampling.py b/meshroom/nodes/aliceVision/LdrToHdrSampling.py index 3a091a39be..fa88ccd3c8 100644 --- a/meshroom/nodes/aliceVision/LdrToHdrSampling.py +++ b/meshroom/nodes/aliceVision/LdrToHdrSampling.py @@ -176,7 +176,7 @@ class LdrToHdrSampling(desc.AVCommandLineNode): name="output", label="Folder", description="Output path for the samples.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/LidarDecimating.py b/meshroom/nodes/aliceVision/LidarDecimating.py index d41ca9853d..8eaf484fc5 100644 --- a/meshroom/nodes/aliceVision/LidarDecimating.py +++ b/meshroom/nodes/aliceVision/LidarDecimating.py @@ -46,12 +46,12 @@ class LidarDecimating(desc.AVCommandLineNode): name="output", label="Sub-Meshes Directory", description="Output directory for sub-meshes.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputJson", label="Scene Description", description="Output scene description.", - value=desc.Node.internalFolder + "scene.json", + value="{nodeCacheFolder}/scene.json", ), ] diff --git a/meshroom/nodes/aliceVision/LidarMerging.py b/meshroom/nodes/aliceVision/LidarMerging.py index 4fd610888d..e107d7c4a0 100644 --- a/meshroom/nodes/aliceVision/LidarMerging.py +++ b/meshroom/nodes/aliceVision/LidarMerging.py @@ -35,6 +35,6 @@ class LidarMerging(desc.AVCommandLineNode): name="output", label="Mesh Path Output", description="Output directory for mesh.", - value=desc.Node.internalFolder + "output.obj", + value="{nodeCacheFolder}/output.obj", ), ] diff --git a/meshroom/nodes/aliceVision/LidarMeshing.py b/meshroom/nodes/aliceVision/LidarMeshing.py index da9aaab638..3ce1a7071f 100644 --- a/meshroom/nodes/aliceVision/LidarMeshing.py +++ b/meshroom/nodes/aliceVision/LidarMeshing.py @@ -126,12 +126,12 @@ class LidarMeshing(desc.AVCommandLineNode): name="output", label="Sub-Meshes Directory", description="Output directory for sub-meshes", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputJson", label="Scene Description", description="Output scene description.", - value=desc.Node.internalFolder + "scene.json", + value="{nodeCacheFolder}/scene.json", ), ] diff --git a/meshroom/nodes/aliceVision/LightingCalibration.py b/meshroom/nodes/aliceVision/LightingCalibration.py index d4a1eee72d..01b1f793b6 100644 --- a/meshroom/nodes/aliceVision/LightingCalibration.py +++ b/meshroom/nodes/aliceVision/LightingCalibration.py @@ -60,14 +60,14 @@ class LightingCalibration(desc.CommandLineNode): name="outputFile", label="Light File", description="Light information will be written here.", - value=desc.Node.internalFolder + "/lights.json", + value="{nodeCacheFolder}/lights.json", ), desc.File( name="lightingEstimationVisualization", label="Estimated Lighting Visualization", description="Estimated Lighting Visualization.", semantic="image", - value=desc.Node.internalFolder + "/_{methodValue}.png", + value="{nodeCacheFolder}/_{methodValue}.png", group=None, ), ] diff --git a/meshroom/nodes/aliceVision/LightingEstimation.py b/meshroom/nodes/aliceVision/LightingEstimation.py index e07d2e3516..3e3193c1fd 100644 --- a/meshroom/nodes/aliceVision/LightingEstimation.py +++ b/meshroom/nodes/aliceVision/LightingEstimation.py @@ -77,6 +77,6 @@ class LightingEstimation(desc.AVCommandLineNode): name="output", label="Folder", description="Folder for output lighting vector files.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/MergeMeshes.py b/meshroom/nodes/aliceVision/MergeMeshes.py index 572865b119..311e7f1b48 100644 --- a/meshroom/nodes/aliceVision/MergeMeshes.py +++ b/meshroom/nodes/aliceVision/MergeMeshes.py @@ -64,6 +64,6 @@ class MergeMeshes(desc.AVCommandLineNode): name="output", label="Mesh", description="Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).", - value=desc.Node.internalFolder + "mesh.stl", + value="{nodeCacheFolder}/mesh.stl", ), ] diff --git a/meshroom/nodes/aliceVision/MeshDecimate.py b/meshroom/nodes/aliceVision/MeshDecimate.py index 0322aff619..a6b092609b 100644 --- a/meshroom/nodes/aliceVision/MeshDecimate.py +++ b/meshroom/nodes/aliceVision/MeshDecimate.py @@ -72,6 +72,6 @@ class MeshDecimate(desc.AVCommandLineNode): name="output", label="Mesh", description="Output mesh in the OBJ file format.", - value=desc.Node.internalFolder + "mesh.obj", + value="{nodeCacheFolder}/mesh.obj", ), ] diff --git a/meshroom/nodes/aliceVision/MeshDenoising.py b/meshroom/nodes/aliceVision/MeshDenoising.py index c159a87093..a7329e45b6 100644 --- a/meshroom/nodes/aliceVision/MeshDenoising.py +++ b/meshroom/nodes/aliceVision/MeshDenoising.py @@ -87,6 +87,6 @@ class MeshDenoising(desc.AVCommandLineNode): name="output", label="Output", description="Output mesh in the OBJ file format.", - value=desc.Node.internalFolder + "mesh.obj", + value="{nodeCacheFolder}/mesh.obj", ), ] diff --git a/meshroom/nodes/aliceVision/MeshFiltering.py b/meshroom/nodes/aliceVision/MeshFiltering.py index e9787dabf7..6eb91d1052 100644 --- a/meshroom/nodes/aliceVision/MeshFiltering.py +++ b/meshroom/nodes/aliceVision/MeshFiltering.py @@ -112,6 +112,6 @@ class MeshFiltering(desc.AVCommandLineNode): name="outputMesh", label="Mesh", description="Output mesh file.", - value=desc.Node.internalFolder + "mesh.{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}", ), ] diff --git a/meshroom/nodes/aliceVision/MeshMasking.py b/meshroom/nodes/aliceVision/MeshMasking.py index a467b1c159..45fa5f329b 100644 --- a/meshroom/nodes/aliceVision/MeshMasking.py +++ b/meshroom/nodes/aliceVision/MeshMasking.py @@ -98,6 +98,6 @@ class MeshMasking(desc.AVCommandLineNode): name="outputMesh", label="Mesh", description="Output mesh file.", - value=desc.Node.internalFolder + "mesh.{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}", ), ] diff --git a/meshroom/nodes/aliceVision/MeshRemoveUnseenFaces.py b/meshroom/nodes/aliceVision/MeshRemoveUnseenFaces.py index aa67076923..c82e3094bf 100644 --- a/meshroom/nodes/aliceVision/MeshRemoveUnseenFaces.py +++ b/meshroom/nodes/aliceVision/MeshRemoveUnseenFaces.py @@ -64,6 +64,6 @@ class MeshRemoveUnseenFaces(desc.AVCommandLineNode): name="outputMesh", label="Mesh", description="Output mesh file.", - value=desc.Node.internalFolder + "mesh.{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}", ), ] diff --git a/meshroom/nodes/aliceVision/MeshResampling.py b/meshroom/nodes/aliceVision/MeshResampling.py index 67488e4d15..d96373adfe 100644 --- a/meshroom/nodes/aliceVision/MeshResampling.py +++ b/meshroom/nodes/aliceVision/MeshResampling.py @@ -77,6 +77,6 @@ class MeshResampling(desc.AVCommandLineNode): name="output", label="Mesh", description="Output mesh in the OBJ file format.", - value=desc.Node.internalFolder + "mesh.obj", + value="{nodeCacheFolder}/mesh.obj", ), ] diff --git a/meshroom/nodes/aliceVision/Meshing.py b/meshroom/nodes/aliceVision/Meshing.py index b448925be2..b01fe33e85 100644 --- a/meshroom/nodes/aliceVision/Meshing.py +++ b/meshroom/nodes/aliceVision/Meshing.py @@ -472,12 +472,12 @@ class Meshing(desc.AVCommandLineNode): name="outputMesh", label="Mesh", description="Output mesh.", - value=desc.Node.internalFolder + "mesh.{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/mesh.{outputMeshFileTypeValue}", ), desc.File( name="output", label="Dense SfMData", description="Output dense point cloud with visibilities (SfMData file format).", - value=desc.Node.internalFolder + "densePointCloud.abc", + value="{nodeCacheFolder}/densePointCloud.abc", ), ] diff --git a/meshroom/nodes/aliceVision/NodalSfM.py b/meshroom/nodes/aliceVision/NodalSfM.py index 5d4094bdd4..1dbd902ced 100644 --- a/meshroom/nodes/aliceVision/NodalSfM.py +++ b/meshroom/nodes/aliceVision/NodalSfM.py @@ -46,6 +46,6 @@ class NodalSfM(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), ] diff --git a/meshroom/nodes/aliceVision/NormalIntegration.py b/meshroom/nodes/aliceVision/NormalIntegration.py index 89b42107e5..207edd8305 100644 --- a/meshroom/nodes/aliceVision/NormalIntegration.py +++ b/meshroom/nodes/aliceVision/NormalIntegration.py @@ -46,7 +46,7 @@ class NormalIntegration(desc.CommandLineNode): label="Depth Map Camera", description="Generated depth in the camera coordinate system.", semantic="image", - value=desc.Node.internalFolder + "_depthMap.exr", + value="{nodeCacheFolder}/_depthMap.exr", group="", # do not export on the command line ) ] diff --git a/meshroom/nodes/aliceVision/NormalMapRendering.py b/meshroom/nodes/aliceVision/NormalMapRendering.py index 7ccbff9809..7355842f76 100644 --- a/meshroom/nodes/aliceVision/NormalMapRendering.py +++ b/meshroom/nodes/aliceVision/NormalMapRendering.py @@ -39,14 +39,14 @@ class NormalMapRendering(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="normal", label="Normal Maps", description="Rendered normal maps.", semantic="image", - value=desc.Node.internalFolder + "_normalMap.exr", + value="{nodeCacheFolder}/_normalMap.exr", group="", # do not export on the command line ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index b1a8e1d1a5..a5ac007aae 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -113,6 +113,6 @@ class PanoramaCompositing(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder containing the composited panorama.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaEstimation.py b/meshroom/nodes/aliceVision/PanoramaEstimation.py index bca57ff20e..d041be7e11 100644 --- a/meshroom/nodes/aliceVision/PanoramaEstimation.py +++ b/meshroom/nodes/aliceVision/PanoramaEstimation.py @@ -170,12 +170,12 @@ class PanoramaEstimation(desc.AVCommandLineNode): name="output", label="SfM File", description="Path to the output SfM file.", - value=desc.Node.internalFolder + "panorama.abc", + value="{nodeCacheFolder}/panorama.abc", ), desc.File( name="outputViewsAndPoses", label="Views And Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaInit.py b/meshroom/nodes/aliceVision/PanoramaInit.py index 1e59afb2a3..a1bf735882 100644 --- a/meshroom/nodes/aliceVision/PanoramaInit.py +++ b/meshroom/nodes/aliceVision/PanoramaInit.py @@ -147,7 +147,7 @@ class PanoramaInit(desc.AVCommandLineNode): label="Contact sheet", semantic="image", description="Contact sheet path.", - value=desc.Node.internalFolder + "contactSheetImage.jpg", + value="{nodeCacheFolder}/contactSheetImage.jpg", group="", # do not export on the command line enabled=lambda node: node.buildContactSheet.enabled ), @@ -155,6 +155,6 @@ class PanoramaInit(desc.AVCommandLineNode): name="outSfMData", label="SfMData File", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaMerging.py b/meshroom/nodes/aliceVision/PanoramaMerging.py index 9e1a60a0f3..413f1f27d0 100644 --- a/meshroom/nodes/aliceVision/PanoramaMerging.py +++ b/meshroom/nodes/aliceVision/PanoramaMerging.py @@ -72,6 +72,6 @@ class PanoramaMerging(desc.AVCommandLineNode): label="Panorama", description="Output merged panorama image.", semantic="image", - value=desc.Node.internalFolder + "panorama.{outputFileTypeValue}", + value="{nodeCacheFolder}/panorama.{outputFileTypeValue}", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaPostProcessing.py b/meshroom/nodes/aliceVision/PanoramaPostProcessing.py index 54d60552a1..1a0a8a4aba 100644 --- a/meshroom/nodes/aliceVision/PanoramaPostProcessing.py +++ b/meshroom/nodes/aliceVision/PanoramaPostProcessing.py @@ -107,20 +107,20 @@ class PanoramaPostProcessing(desc.CommandLineNode): label="Output Panorama Preview", description="Preview of the generated panorama in JPG format.", semantic="image", - value=lambda attr: desc.Node.internalFolder + attr.node.previewName.value, + value=lambda attr: "{nodeCacheFolder}/" + attr.node.previewName.value, ), desc.File( name="outputPanorama", label="Output Panorama", description="Generated panorama in EXR format.", semantic="image", - value=lambda attr: desc.Node.internalFolder + attr.node.panoramaName.value, + value=lambda attr: "{nodeCacheFolder}/" + attr.node.panoramaName.value, ), desc.File( name="downscaledPanoramaLevels", label="Downscaled Panorama Levels", description="Downscaled versions of the generated panorama.", - value=lambda attr: desc.Node.internalFolder + os.path.splitext(attr.node.panoramaName.value)[0] + "_level_*.exr", + value=lambda attr: "{nodeCacheFolder}/" + os.path.splitext(attr.node.panoramaName.value)[0] + "_level_*.exr", group="", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaPrepareImages.py b/meshroom/nodes/aliceVision/PanoramaPrepareImages.py index d23d84299e..6a4f6137dc 100644 --- a/meshroom/nodes/aliceVision/PanoramaPrepareImages.py +++ b/meshroom/nodes/aliceVision/PanoramaPrepareImages.py @@ -36,6 +36,6 @@ class PanoramaPrepareImages(desc.AVCommandLineNode): name="output", label="SfMData", description="Output SfMData file.", - value=lambda attr: desc.Node.internalFolder + os.path.basename(attr.node.input.value), + value=lambda attr: "{nodeCacheFolder}/" + os.path.basename(attr.node.input.value), ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaSeams.py b/meshroom/nodes/aliceVision/PanoramaSeams.py index 0798c2a1ed..ffadc05843 100644 --- a/meshroom/nodes/aliceVision/PanoramaSeams.py +++ b/meshroom/nodes/aliceVision/PanoramaSeams.py @@ -59,12 +59,12 @@ class PanoramaSeams(desc.AVCommandLineNode): label="Labels", description="", semantic="image", - value=desc.Node.internalFolder + "labels.exr", + value="{nodeCacheFolder}/labels.exr", ), desc.File( name="outputSfm", label="Output SfMData File", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "panorama.sfm", + value="{nodeCacheFolder}/panorama.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/PanoramaWarping.py b/meshroom/nodes/aliceVision/PanoramaWarping.py index c86158c59e..2a4a062689 100644 --- a/meshroom/nodes/aliceVision/PanoramaWarping.py +++ b/meshroom/nodes/aliceVision/PanoramaWarping.py @@ -93,6 +93,6 @@ class PanoramaWarping(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/PhotometricStereo.py b/meshroom/nodes/aliceVision/PhotometricStereo.py index 7caefa40ec..6ca877e8e9 100644 --- a/meshroom/nodes/aliceVision/PhotometricStereo.py +++ b/meshroom/nodes/aliceVision/PhotometricStereo.py @@ -78,27 +78,27 @@ class PhotometricStereo(desc.CommandLineNode): name="outputPath", label="Output Folder", description="Path to the output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputSfmDataAlbedo", label="SfMData Albedo", description="Output SfMData file containing the albedo information.", - value=desc.Node.internalFolder + "/albedoMaps.sfm", + value="{nodeCacheFolder}/albedoMaps.sfm", group="", # remove from command line ), desc.File( name="outputSfmDataNormal", label="SfMData Normal", description="Output SfMData file containing the normal maps information.", - value=desc.Node.internalFolder + "/normalMaps.sfm", + value="{nodeCacheFolder}/normalMaps.sfm", group="", # remove from command line ), desc.File( name="outputSfmDataNormalPNG", label="SfMData Normal PNG", description="Output SfMData file containing the normal maps information.", - value=desc.Node.internalFolder + "/normalMapsPNG.sfm", + value="{nodeCacheFolder}/normalMapsPNG.sfm", group="", # remove from command line ), # these attributes are only here to describe more accurately the output of the node @@ -109,7 +109,7 @@ class PhotometricStereo(desc.CommandLineNode): label="Normal Maps Camera", description="Generated normal maps in the camera coordinate system.", semantic="image", - value=desc.Node.internalFolder + "_normals.exr", + value="{nodeCacheFolder}/_normals.exr", group="", # do not export on the command line ), desc.File( @@ -117,7 +117,7 @@ class PhotometricStereo(desc.CommandLineNode): label="Normal Maps Camera (in false colors)", description="Generated normal maps in the camera coordinate system (in false colors).", semantic="image", - value=desc.Node.internalFolder + "_normals.png", + value="{nodeCacheFolder}/_normals.png", group="", # do not export on the command line ), desc.File( @@ -125,7 +125,7 @@ class PhotometricStereo(desc.CommandLineNode): label="Normal Maps World", description="Generated normal maps in the world coordinate system.", semantic="image", - value=desc.Node.internalFolder + "_normals_w.exr", + value="{nodeCacheFolder}/_normals_w.exr", group="", # do not export on the command line ), @@ -134,7 +134,7 @@ class PhotometricStereo(desc.CommandLineNode): label="Albedo Maps", description="Generated albedo maps.", semantic="image", - value=desc.Node.internalFolder + "_albedo.png", + value="{nodeCacheFolder}/_albedo.png", group="", # do not export on the command line ), ] diff --git a/meshroom/nodes/aliceVision/PrepareDenseScene.py b/meshroom/nodes/aliceVision/PrepareDenseScene.py index e992d31057..87eb78bc20 100644 --- a/meshroom/nodes/aliceVision/PrepareDenseScene.py +++ b/meshroom/nodes/aliceVision/PrepareDenseScene.py @@ -94,14 +94,14 @@ class PrepareDenseScene(desc.AVCommandLineNode): name="output", label="Images Folder", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="undistorted", label="Undistorted Images", description="List of undistorted images.", semantic="image", - value=desc.Node.internalFolder + ".{outputFileTypeValue}", + value="{nodeCacheFolder}/.{outputFileTypeValue}", group="", advanced=True, ), diff --git a/meshroom/nodes/aliceVision/RelativePoseEstimating.py b/meshroom/nodes/aliceVision/RelativePoseEstimating.py index 94254ffaf6..8c1c59ccc5 100644 --- a/meshroom/nodes/aliceVision/RelativePoseEstimating.py +++ b/meshroom/nodes/aliceVision/RelativePoseEstimating.py @@ -48,6 +48,6 @@ class RelativePoseEstimating(desc.AVCommandLineNode): name="output", label="Pairs Info", description="Path to the output Pairs info files directory.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/SelectConnectedViews.py b/meshroom/nodes/aliceVision/SelectConnectedViews.py index 1f82b8166c..3db36f8062 100644 --- a/meshroom/nodes/aliceVision/SelectConnectedViews.py +++ b/meshroom/nodes/aliceVision/SelectConnectedViews.py @@ -59,6 +59,6 @@ class SelectConnectedViews(desc.AVCommandLineNode): name="output", label="Connected Views", description="List of connected views in a text file.", - value=desc.Node.internalFolder + "connectedViews.txt", + value="{nodeCacheFolder}/connectedViews.txt", ), ] diff --git a/meshroom/nodes/aliceVision/SfMAlignment.py b/meshroom/nodes/aliceVision/SfMAlignment.py index e8b6fbb9b2..436ab2a911 100644 --- a/meshroom/nodes/aliceVision/SfMAlignment.py +++ b/meshroom/nodes/aliceVision/SfMAlignment.py @@ -107,12 +107,12 @@ class SfMAlignment(desc.AVCommandLineNode): name="output", label="SfMData File", description="Output SfMData file.", - value=lambda attr: desc.Node.internalFolder + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", + value=lambda attr: "{nodeCacheFolder}/" + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", ), desc.File( name="outputViewsAndPoses", label="Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMChecking.py b/meshroom/nodes/aliceVision/SfMChecking.py index de191e1ae9..2e160bba42 100644 --- a/meshroom/nodes/aliceVision/SfMChecking.py +++ b/meshroom/nodes/aliceVision/SfMChecking.py @@ -40,7 +40,7 @@ class SfMChecking(desc.Node): name="output", label="SfM File", description="Path to the output SfM file.", - value=desc.Node.internalFolder + "sfmData.abc", + value="{nodeCacheFolder}/sfmData.abc", ) ] diff --git a/meshroom/nodes/aliceVision/SfMColorizing.py b/meshroom/nodes/aliceVision/SfMColorizing.py index 70af8797a6..bf74217145 100644 --- a/meshroom/nodes/aliceVision/SfMColorizing.py +++ b/meshroom/nodes/aliceVision/SfMColorizing.py @@ -36,6 +36,6 @@ class SfMColorizing(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM file.", - value=desc.Node.internalFolder + "sfmData.abc", + value="{nodeCacheFolder}/sfmData.abc", ), ] diff --git a/meshroom/nodes/aliceVision/SfMFilter.py b/meshroom/nodes/aliceVision/SfMFilter.py index 78978fd374..7193a65ec9 100644 --- a/meshroom/nodes/aliceVision/SfMFilter.py +++ b/meshroom/nodes/aliceVision/SfMFilter.py @@ -46,12 +46,12 @@ class SfMFilter(desc.CommandLineNode): name="outputSfMData_selected", label="SfMData_selected", description="Output SfMData file containing selected views.", - value=desc.Node.internalFolder + "/selectedSfmData.sfm", + value="{nodeCacheFolder}/selectedSfmData.sfm", ), desc.File( name="outputSfMData_unselected", label="SfMData_unselected", description="Output SfMData file containing remaining views.", - value=desc.Node.internalFolder + "/unselectedSfmData.sfm", + value="{nodeCacheFolder}/unselectedSfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMMerge.py b/meshroom/nodes/aliceVision/SfMMerge.py index 9c21243c7e..bf78be751b 100644 --- a/meshroom/nodes/aliceVision/SfMMerge.py +++ b/meshroom/nodes/aliceVision/SfMMerge.py @@ -96,6 +96,6 @@ class SfMMerge(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM file (in SfMData format).", - value=lambda attr: desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMPoseInjecting.py b/meshroom/nodes/aliceVision/SfMPoseInjecting.py index 5334a3c153..c656b860ff 100644 --- a/meshroom/nodes/aliceVision/SfMPoseInjecting.py +++ b/meshroom/nodes/aliceVision/SfMPoseInjecting.py @@ -50,6 +50,6 @@ class SfMPoseInjecting(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM file.", - value=desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMSplitReconstructed.py b/meshroom/nodes/aliceVision/SfMSplitReconstructed.py index 39da9da79f..eb237a416d 100644 --- a/meshroom/nodes/aliceVision/SfMSplitReconstructed.py +++ b/meshroom/nodes/aliceVision/SfMSplitReconstructed.py @@ -36,12 +36,12 @@ class SfMSplitReconstructed(desc.AVCommandLineNode): name="reconstructedOutput", label="Reconstructed SfMData File", description="SfMData file containing the reconstructed cameras.", - value=desc.Node.internalFolder + "sfmReconstructed.abc", + value="{nodeCacheFolder}/sfmReconstructed.abc", ), desc.File( name="notReconstructedOutput", label="Not Reconstructed SfMData File", description="SfMData file containing the non-reconstructed cameras.", - value=desc.Node.internalFolder + "sfmNonReconstructed.abc", + value="{nodeCacheFolder}/sfmNonReconstructed.abc", ), ] diff --git a/meshroom/nodes/aliceVision/SfMToRig.py b/meshroom/nodes/aliceVision/SfMToRig.py index 74260205f4..468cf6c2ca 100644 --- a/meshroom/nodes/aliceVision/SfMToRig.py +++ b/meshroom/nodes/aliceVision/SfMToRig.py @@ -35,6 +35,6 @@ class SfMToRig(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM file (in SfMData format).", - value=lambda attr: desc.Node.internalFolder + "sfmData.sfm", + value="{nodeCacheFolder}/sfmData.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMTransfer.py b/meshroom/nodes/aliceVision/SfMTransfer.py index 3eef69f8d9..2b144d4abc 100644 --- a/meshroom/nodes/aliceVision/SfMTransfer.py +++ b/meshroom/nodes/aliceVision/SfMTransfer.py @@ -99,12 +99,12 @@ class SfMTransfer(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM point cloud file (in SfMData format).", - value=lambda attr: desc.Node.internalFolder + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", + value=lambda attr: "{nodeCacheFolder}/" + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", ), desc.File( name="outputViewsAndPoses", label="Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMTransform.py b/meshroom/nodes/aliceVision/SfMTransform.py index 0a8d868807..eab001937b 100644 --- a/meshroom/nodes/aliceVision/SfMTransform.py +++ b/meshroom/nodes/aliceVision/SfMTransform.py @@ -255,12 +255,12 @@ class SfMTransform(desc.AVCommandLineNode): name="output", label="SfMData File", description="Aligned SfMData file.", - value=lambda attr: desc.Node.internalFolder + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", + value=lambda attr: "{nodeCacheFolder}/" + (os.path.splitext(os.path.basename(attr.node.input.value))[0] or "sfmData") + ".abc", ), desc.File( name="outputViewsAndPoses", label="Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/SfMTriangulation.py b/meshroom/nodes/aliceVision/SfMTriangulation.py index 59e2c9cad3..06ce61ed00 100644 --- a/meshroom/nodes/aliceVision/SfMTriangulation.py +++ b/meshroom/nodes/aliceVision/SfMTriangulation.py @@ -143,12 +143,12 @@ class SfMTriangulation(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), desc.File( name="extraInfoFolder", label="Folder", description="Folder for intermediate reconstruction files and additional reconstruction information files.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/SfmBootstraping.py b/meshroom/nodes/aliceVision/SfmBootstraping.py index c2eeaefb83..aa6950ba0c 100644 --- a/meshroom/nodes/aliceVision/SfmBootstraping.py +++ b/meshroom/nodes/aliceVision/SfmBootstraping.py @@ -73,6 +73,6 @@ class SfMBootStraping(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.json", + value="{nodeCacheFolder}/sfm.json", ), ] diff --git a/meshroom/nodes/aliceVision/SfmExpanding.py b/meshroom/nodes/aliceVision/SfmExpanding.py index f96cefed69..f8a21c5d21 100644 --- a/meshroom/nodes/aliceVision/SfmExpanding.py +++ b/meshroom/nodes/aliceVision/SfmExpanding.py @@ -164,6 +164,6 @@ class SfMExpanding(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfMData file.", - value=desc.Node.internalFolder + "sfm.json", + value="{nodeCacheFolder}/sfm.json", ), ] diff --git a/meshroom/nodes/aliceVision/SphereDetection.py b/meshroom/nodes/aliceVision/SphereDetection.py index cea9120d5a..a58fcba98c 100644 --- a/meshroom/nodes/aliceVision/SphereDetection.py +++ b/meshroom/nodes/aliceVision/SphereDetection.py @@ -84,6 +84,6 @@ class SphereDetection(desc.CommandLineNode): name="output", label="Output Path", description="Sphere detection information will be written here.", - value=desc.Node.internalFolder + "/detection.json", + value="{nodeCacheFolder}/detection.json", ) ] diff --git a/meshroom/nodes/aliceVision/Split360Images.py b/meshroom/nodes/aliceVision/Split360Images.py index 733333fad2..b14db371c9 100644 --- a/meshroom/nodes/aliceVision/Split360Images.py +++ b/meshroom/nodes/aliceVision/Split360Images.py @@ -128,12 +128,12 @@ class Split360Images(desc.AVCommandLineNode): name="output", label="Folder", description="Output folder for extracted frames.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outSfMData", label="SfMData File", description="Output SfMData file.", - value=desc.Node.internalFolder + "rig.sfm", + value="{nodeCacheFolder}/rig.sfm", ), ] diff --git a/meshroom/nodes/aliceVision/StructureFromMotion.py b/meshroom/nodes/aliceVision/StructureFromMotion.py index 9c754e7e52..393d3143db 100644 --- a/meshroom/nodes/aliceVision/StructureFromMotion.py +++ b/meshroom/nodes/aliceVision/StructureFromMotion.py @@ -376,18 +376,18 @@ class StructureFromMotion(desc.AVCommandLineNode): name="output", label="SfMData", description="Path to the output SfM point cloud file (in SfMData format).", - value=desc.Node.internalFolder + "sfm.abc", + value="{nodeCacheFolder}/sfm.abc", ), desc.File( name="outputViewsAndPoses", label="Views And Poses", description="Path to the output SfMData file with cameras (views and poses).", - value=desc.Node.internalFolder + "cameras.sfm", + value="{nodeCacheFolder}/cameras.sfm", ), desc.File( name="extraInfoFolder", label="Folder", description="Folder for intermediate reconstruction files and additional reconstruction information files.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), ] diff --git a/meshroom/nodes/aliceVision/Texturing.py b/meshroom/nodes/aliceVision/Texturing.py index 057d3e7d0c..87295bf877 100644 --- a/meshroom/nodes/aliceVision/Texturing.py +++ b/meshroom/nodes/aliceVision/Texturing.py @@ -336,13 +336,13 @@ class Texturing(desc.AVCommandLineNode): name="output", label="Folder", description="Folder for output mesh: OBJ, material and texture files.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="outputMesh", label="Mesh", description="Output mesh file.", - value=desc.Node.internalFolder + "texturedMesh.{outputMeshFileTypeValue}", + value="{nodeCacheFolder}/texturedMesh.{outputMeshFileTypeValue}", group="", ), desc.File( @@ -350,22 +350,22 @@ class Texturing(desc.AVCommandLineNode): enabled=lambda node: node.outputMeshFileType.value == "obj", label="Material", description="Output material file.", - value=desc.Node.internalFolder + "texturedMesh.mtl", + value="{nodeCacheFolder}/texturedMesh.mtl", group="", ), desc.File( name="outputTextures", label="Textures", description="Output texture files.", - value=lambda attr: desc.Node.internalFolder + "texture_*." + attr.node.colorMapping.colorMappingFileType.value if attr.node.colorMapping.enable.value else "", + value=lambda attr: "{nodeCacheFolder}/texture_*." + attr.node.colorMapping.colorMappingFileType.value if attr.node.colorMapping.enable.value else "", group="", ), ] def upgradeAttributeValues(self, attrValues, fromVersion): if fromVersion < Version(6, 0): - outputTextureFileType = attrValues['outputTextureFileType'] + outputTextureFileType = attrValues["outputTextureFileType"] if isinstance(outputTextureFileType, str): - attrValues['colorMapping'] = {} - attrValues['colorMapping']['colorMappingFileType'] = outputTextureFileType + attrValues["colorMapping"] = {} + attrValues["colorMapping"]["colorMappingFileType"] = outputTextureFileType return attrValues diff --git a/meshroom/nodes/aliceVision/TracksBuilding.py b/meshroom/nodes/aliceVision/TracksBuilding.py index 769069cdea..1a52185545 100644 --- a/meshroom/nodes/aliceVision/TracksBuilding.py +++ b/meshroom/nodes/aliceVision/TracksBuilding.py @@ -92,6 +92,6 @@ class TracksBuilding(desc.AVCommandLineNode): name="output", label="Tracks", description="Path to the output tracks file.", - value=desc.Node.internalFolder + "tracksFile.json", + value="{nodeCacheFolder}/tracksFile.json", ), ] diff --git a/meshroom/nodes/blender/ScenePreview.py b/meshroom/nodes/blender/ScenePreview.py index 7853f9b1f0..4467082936 100644 --- a/meshroom/nodes/blender/ScenePreview.py +++ b/meshroom/nodes/blender/ScenePreview.py @@ -128,14 +128,14 @@ class ScenePreview(desc.CommandLineNode): name="output", label="Output", description="Output folder.", - value=desc.Node.internalFolder, + value="{nodeCacheFolder}", ), desc.File( name="frames", label="Frames", description="Frames rendered in Blender.", semantic="image", - value=desc.Node.internalFolder + "_preview.jpg", + value="{nodeCacheFolder}/_preview.jpg", group="", ), ] From 6d6f700eeae9c05b9b9f5eb673fdc1312b87b0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 8 Jan 2025 19:00:01 +0100 Subject: [PATCH 04/10] [tests] Replace `desc.Node.internalFolder` with `{nodeCacheFolder}` --- tests/nodes/test/appendFiles.py | 2 +- tests/nodes/test/appendText.py | 2 +- tests/nodes/test/ls.py | 2 +- tests/test_compatibility.py | 16 ++++++++-------- tests/test_invalidation.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/nodes/test/appendFiles.py b/tests/nodes/test/appendFiles.py index 78e7fefab6..9f9c0b236e 100644 --- a/tests/nodes/test/appendFiles.py +++ b/tests/nodes/test/appendFiles.py @@ -36,7 +36,7 @@ class AppendFiles(desc.CommandLineNode): name='output', label='Output', description='''''', - value=desc.Node.internalFolder + 'appendText.txt', + value='{nodeCacheFolder}/appendText.txt', ) ] diff --git a/tests/nodes/test/appendText.py b/tests/nodes/test/appendText.py index 6d49bc7c60..07b722045b 100644 --- a/tests/nodes/test/appendText.py +++ b/tests/nodes/test/appendText.py @@ -24,6 +24,6 @@ class AppendText(desc.CommandLineNode): name='output', label='Output', description='''''', - value=desc.Node.internalFolder + 'appendText.txt', + value='{nodeCacheFolder}/appendText.txt', ), ] diff --git a/tests/nodes/test/ls.py b/tests/nodes/test/ls.py index 6b750e2ce8..d359936868 100644 --- a/tests/nodes/test/ls.py +++ b/tests/nodes/test/ls.py @@ -17,6 +17,6 @@ class Ls(desc.CommandLineNode): name='output', label='Output', description='''''', - value=desc.Node.internalFolder + 'ls.txt', + value='{nodeCacheFolder}/ls.txt', ) ] diff --git a/tests/test_compatibility.py b/tests/test_compatibility.py index 00505352e7..c5990171a9 100644 --- a/tests/test_compatibility.py +++ b/tests/test_compatibility.py @@ -53,7 +53,7 @@ class SampleNodeV1(desc.Node): desc.StringParam(name='paramA', label='ParamA', description='', value='', invalidate=False) # No impact on UID ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -66,7 +66,7 @@ class SampleNodeV2(desc.Node): desc.StringParam(name='paramA', label='ParamA', description='', value='', invalidate=False), # No impact on UID ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -79,7 +79,7 @@ class SampleNodeV3(desc.Node): desc.File(name='in', label='Input', description='', value='',), ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -96,7 +96,7 @@ class SampleNodeV4(desc.Node): description='') ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -113,7 +113,7 @@ class SampleNodeV5(desc.Node): description='') ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -130,7 +130,7 @@ class SampleNodeV6(desc.Node): description='') ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -140,7 +140,7 @@ class SampleInputNodeV1(desc.InputNode): desc.StringParam(name='path', label='path', description='', value='', invalidate=False) # No impact on UID ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] @@ -152,7 +152,7 @@ class SampleInputNodeV2(desc.InputNode): desc.StringParam(name='in', label='path', description='', value='', invalidate=False) # No impact on UID ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] diff --git a/tests/test_invalidation.py b/tests/test_invalidation.py index af40618ecf..9dfe0879e7 100644 --- a/tests/test_invalidation.py +++ b/tests/test_invalidation.py @@ -11,7 +11,7 @@ class SampleNode(desc.Node): desc.StringParam(name='paramA', label='ParamA', description='', value='', invalidate=False) # No impact on UID ] outputs = [ - desc.File(name='output', label='Output', description='', value=desc.Node.internalFolder) + desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}") ] From 659ebeeaa29e97d9d5ef9f844aac4e1c5350fcd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 8 Jan 2025 19:01:04 +0100 Subject: [PATCH 05/10] [desc] Remove `internalFolder` in `desc.Node` This is fully replaced with `{nodeCacheFolder}`. --- meshroom/core/desc/node.py | 1 - 1 file changed, 1 deletion(-) diff --git a/meshroom/core/desc/node.py b/meshroom/core/desc/node.py index 9b46ca889f..0278174df2 100644 --- a/meshroom/core/desc/node.py +++ b/meshroom/core/desc/node.py @@ -13,7 +13,6 @@ class Node(object): """ """ - internalFolder = '{cache}/{nodeType}/{uid}/' cpu = Level.NORMAL gpu = Level.NONE ram = Level.NORMAL From d402088cdee1e1e4e931ef38143ee1b92a3e3c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Mon, 13 Jan 2025 17:12:23 +0100 Subject: [PATCH 06/10] [nodes] CameraInit: Use node's internal folder instead of the description's --- meshroom/nodes/aliceVision/CameraInit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index 227d9e1669..bf2c1cf381 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -670,7 +670,7 @@ def createViewpointsFile(self, node, additionalViews=()): "featureFolder": "", "matchingFolder": "", } - node.viewpointsFile = os.path.join(node.nodeDesc.internalFolder, 'viewpoints.sfm').format(**node._cmdVars) + node.viewpointsFile = os.path.join(node.internalFolder, 'viewpoints.sfm').format(**node._cmdVars) with open(node.viewpointsFile, 'w') as f: json.dump(sfmData, f, indent=4) From 05848d9022c3e56407f21bf4b34149fe1b93b3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Tue, 14 Jan 2025 15:56:06 +0100 Subject: [PATCH 07/10] [core] Node: Resolve `nodeCacheFolder` without `cache` for outputs --- meshroom/core/node.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 0d45774ddc..2a684201fe 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -769,7 +769,11 @@ def _buildAttributeCmdVars(cmdVars, name, attr): # For updating output attributes invalidation values cmdVarsNoCache = self._cmdVars.copy() - cmdVarsNoCache['cache'] = '' + cmdVarsNoCache["cache"] = "" + + # Use "self._internalFolder" instead of "self.internalFolder" because we do not want it to be + # resolved with the {cache} information ("self.internalFolder" resolves "self._internalFolder") + cmdVarsNoCache["nodeCacheFolder"] = self._internalFolder.format(**cmdVarsNoCache) # Evaluate output params for name, attr in self._attributes.objects.items(): From a565b00f6d74146093dcf363eda7feaae1a59ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Tue, 14 Jan 2025 17:33:27 +0100 Subject: [PATCH 08/10] [core] Attribute: Strip ending "/" from invalidation values By doing so, invalidation values will evaluate to the same UID independently from whether the attribute's value has been written with an extra "/" or not. --- meshroom/core/attribute.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meshroom/core/attribute.py b/meshroom/core/attribute.py index 3f9c2f69f9..25c3b81d52 100644 --- a/meshroom/core/attribute.py +++ b/meshroom/core/attribute.py @@ -267,8 +267,11 @@ def uid(self): # To guarantee that each output attribute receives a unique ID, we add the attribute name to it. return hashValue((self.name, self.node._uid)) else: - # only dependent on the hash of its value without the cache folder - return hashValue(self._invalidationValue) + # Only dependent on the hash of its value without the cache folder. + # "/" at the end of the link is stripped to prevent having different UIDs depending on + # whether the invalidation value finishes with it or not + strippedInvalidationValue = self._invalidationValue.rstrip("/") + return hashValue(strippedInvalidationValue) if self.isLink: linkParam = self.getLinkParam(recursive=True) return linkParam.uid() From bd42f704b113f9bf2a2e859cdb516df813e369e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 23 Jan 2025 09:54:22 +0100 Subject: [PATCH 09/10] [nodes] ScenePreview: Use `{nodeSourceCodeFolder}` for the script's path --- meshroom/nodes/blender/ScenePreview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/blender/ScenePreview.py b/meshroom/nodes/blender/ScenePreview.py index 4467082936..154a841e3c 100644 --- a/meshroom/nodes/blender/ScenePreview.py +++ b/meshroom/nodes/blender/ScenePreview.py @@ -32,7 +32,7 @@ class ScenePreview(desc.CommandLineNode): name="script", label="Script", description="Path to the internal script for rendering in Blender.", - value=os.path.join(currentDir, "scripts", "preview.py"), + value=os.path.join("{nodeSourceCodeFolder}", "scripts", "preview.py"), invalidate=False, group="", advanced=True, From 0dd5c102ea6265dd5425511020f789584d55f6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 23 Jan 2025 10:01:59 +0100 Subject: [PATCH 10/10] [GraphEditor] Use attribute's evaluated value for "Open File" Otherwise, input attributes with variables (either environment ones or local ones) cannot be opened through "Open File", even though "Open Containing Folder" works fine. --- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 7914dd86c5..351a74fda8 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -152,7 +152,7 @@ RowLayout { visible: paramMenu.isFilepath height: visible ? implicitHeight : 0 text: "Open File" - onClicked: Qt.openUrlExternally(Filepath.stringToUrl(attribute.value)) + onClicked: Qt.openUrlExternally(Filepath.stringToUrl(attribute.evalValue)) } }