Added the option to log command line arguments to OpenSeeLauncher.

This commit is contained in:
Emiliana 2020-08-22 11:55:54 +02:00
parent 8c079f4e9b
commit 91b1c35a12

View file

@ -59,6 +59,8 @@ public class OpenSeeLauncher : MonoBehaviour {
public List<string> commandlineOptions = new List<string>(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();