You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Ursina loads, it automatically looks for a file called "settings.py" in the project root and runs it. This behaviour isn't properly documented anywhere; the only reference to it seems to be in the samples here.
While this behaviour could be useful for loading in settings, it causes some problems if people are unaware of it and coincidentally create an unrelated settings.py file in the root dir.
P.S. I don't use Python much, so please forgive my ignorance if this is a common pattern in Python that I'm unaware of. But even so, it would be useful to have it documented :)
The text was updated successfully, but these errors were encountered:
I kind of agree actually. What would be a better solution? I like users being able to configure the game/program for settings and whatnot, and for developers to have local settings, like custom window position for example.
Not sure what the best solution is, but definitely start by documenting the behaviour.
Do the settings need to be in a python file? Perhaps the settings file could use a file extension other than .py. Though that may be a little misleading admittedly, as people wouldn't expect it to run code.
Alternatively, if settings.py is just for configuration options, perhaps it doesn't need to run any code at all. It could just be a JSON file and ursina could read in the options and set them automatically.
When Ursina loads, it automatically looks for a file called "settings.py" in the project root and runs it. This behaviour isn't properly documented anywhere; the only reference to it seems to be in the samples here.
While this behaviour could be useful for loading in settings, it causes some problems if people are unaware of it and coincidentally create an unrelated settings.py file in the root dir.
Related lines in Ursina source code:
main.py
application.py
P.S. I don't use Python much, so please forgive my ignorance if this is a common pattern in Python that I'm unaware of. But even so, it would be useful to have it documented :)
The text was updated successfully, but these errors were encountered: