com.unity.perception
com.unity.perception copied to clipboard
Use endpoint output path in builds
Hey,
We're using perception cameras with configurable output directories both in the editor and in builds. To change the dataset output directory we're doing ((PerceptionEndpoint)PerceptionSettings.instance.endpoint).basePath = datasetDir
.
But this won't work in builds, since the endpoint output path is not checked - the --output-path
CLI option is checked instead. We'd like to be able to set the dataset dir in the same way for the editor and in builds, so that users don't need to know this CLI option.
Would it be possible to check the endpoint output path before falling back to defaultOutputPath
? e.g. if --output-path
is not set, the endpoint is checked, and if that's also not set then the fallback happens. I believe these are the relevant lines in the code.
Thanks!
Hi @jmacpereira, unfortunately the value for the user's directory is stored in the user settings. This value is only accessible via editor code and is not compiled into a built player. So unfortunately, once the player is built, we cannot access that string.
Looking at the code, I thought the output path comes from user settings, but even if it's empty (user settings file not found) if someone sets it at runtime like we're doing, it would still stay in the userPreferences
Metadata dictionary.
In any case we would like the feature of changing the dataset output path at runtime, including in player builds, since that would fit our use case better.
Thanks for the comment. I will record it as a feature request and we can look to see if we can support it.
Any update about this? @StevenBorkman
Hey @jmacpereira, it is on our backlog but we haven't been able to work on it yet.
How would you envision being able to set output path at runtime in player builds?
@StevenBorkman With a call to a Perception settings method, such as PerceptionSettings.SetOutputBasePath(). This method exists, but doesn't actually change the result of OutputBasePath() when running in a build.
Users might need to call DatasetCapture.ResetSimulation() after setting the path, and that's ok - but currently it doesn't work in builds even after calling this method