From 91b1c35a126ae9882c02b9f69963be580970d735 Mon Sep 17 00:00:00 2001 From: Emiliana <38952746+emilianavt@users.noreply.github.com> Date: Sat, 22 Aug 2020 11:55:54 +0200 Subject: [PATCH] Added the option to log command line arguments to `OpenSeeLauncher`. --- Unity/OpenSeeLauncher.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Unity/OpenSeeLauncher.cs b/Unity/OpenSeeLauncher.cs index ad2e537..3c76457 100644 --- a/Unity/OpenSeeLauncher.cs +++ b/Unity/OpenSeeLauncher.cs @@ -59,6 +59,8 @@ public class OpenSeeLauncher : MonoBehaviour { public List commandlineOptions = new List(new string[] { "--silent", "1", "--max-threads", "4" }); [Tooltip("This string will be appended at the end of the tracker options without quoting.")] public string extraOptions = ""; + [Tooltip("If enabled, the tracker commandline option string will be logged with Debug.Log.")] + public bool logCommandline = false; [Tooltip("IL2CPP doesn't support Proocess.Start. When this is enabled, OpenSeeLauncher will create the tracking process by calling the necessary API functions directly through the DLLs. In this case, reading the standard output from the process will not be supported and it will instead be send to the logfiles set in pinvokeStdOut and pinvokeStdErr in the persistent data directory. It will also retrieve the camera list directly through the libdshowcapture DLLs, so make sure it is part of your Unity project.")] public bool usePinvoke = false; [Tooltip("When this is enabled, even if usePinvoke is disabled, the camera list will be retrieved through libdshowcapture DLLs directly, which can be faster. Make sure the DLLs are in your Unity project.")] @@ -267,6 +269,9 @@ public class OpenSeeLauncher : MonoBehaviour { string argumentString = EscapeArguments(arguments.ToArray()); if (extraOptions != "") argumentString = argumentString + " " + extraOptions; + + if (logCommandline) + UnityEngine.Debug.Log("Starting tracker: " + argumentString); StopTracker(); @@ -279,7 +284,7 @@ public class OpenSeeLauncher : MonoBehaviour { processStartInfo.RedirectStandardError = true; processStartInfo.UseShellExecute = false; processStartInfo.FileName = exePath; - processStartInfo.Arguments = argumentString; + processStartInfo.Arguments = "facetracker " + argumentString; trackerSB = new StringBuilder(); trackerProcess = new Process();