Set the Value of a Setting

You can interact with app, extension, and user settings using the ISettings interface from the carb.settings module. This snippet shows how to set the value of a new or existing setting.


Each extension puts settings in /ext/[ext_name]/ to not conflict with settings from other extensions. Extensions should also list their settings in their extension.toml to make the settings discoverable to users and developers.

import carb.settings

settings = carb.settings.get_settings()

# set different types into different keys
settings.set("/exts/", 23)
settings.set("/exts/", 502.45)
settings.set("/exts/", False)
settings.set("/exts/", "summer")
settings.set("/exts/", [9,13,17,21])
settings.set("/exts/", { "a": 2, "b": "winter"})

# print all: