From 7373fdd35db9393970f42691f45396a26a142456 Mon Sep 17 00:00:00 2001 From: Pavel Kulik Date: Fri, 10 Jan 2025 14:35:20 -0800 Subject: [PATCH] Set PathParameter default to "None" when not required --- Source/Processors/Parameter/Parameter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Processors/Parameter/Parameter.cpp b/Source/Processors/Parameter/Parameter.cpp index 6b3e3fc37..3ba73ed16 100755 --- a/Source/Processors/Parameter/Parameter.cpp +++ b/Source/Processors/Parameter/Parameter.cpp @@ -1198,7 +1198,9 @@ PathParameter::PathParameter (ParameterOwner* owner, isDirectory (isDirectory_), isRequired (isRequired_) { - currentValue = defaultValue; + currentValue = "None"; + if (isRequired) + currentValue = defaultValue; } void PathParameter::setNextValue (var newValue_, bool undoable) @@ -1248,7 +1250,10 @@ bool PathParameter::isValid() { if (currentValue.toString() == "default") { - currentValue = defaultValue; + if (isRequired) + currentValue = defaultValue; + else + currentValue = "None"; return true; } else if (! isDirectory && File (currentValue.toString()).existsAsFile())