com.unity.perception icon indicating copy to clipboard operation
com.unity.perception copied to clipboard

Use endpoint output path in builds

Open jmacpereira opened this issue 2 years ago • 7 comments

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!

jmacpereira avatar Apr 29 '22 08:04 jmacpereira

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.

StevenBorkman avatar Apr 29 '22 19:04 StevenBorkman

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.

jmacpereira avatar May 03 '22 13:05 jmacpereira

Thanks for the comment. I will record it as a feature request and we can look to see if we can support it.

StevenBorkman avatar May 06 '22 16:05 StevenBorkman

Any update about this? @StevenBorkman

jmacpereira avatar Jul 04 '22 10:07 jmacpereira

Hey @jmacpereira, it is on our backlog but we haven't been able to work on it yet.

StevenBorkman avatar Jul 05 '22 21:07 StevenBorkman

How would you envision being able to set output path at runtime in player builds?

StevenBorkman avatar Jul 05 '22 21:07 StevenBorkman

@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

joaomacp avatar Feb 20 '24 11:02 joaomacp