diff --git a/plugins/utilities.json b/plugins/utilities.json index ad3ad27..c1a86a6 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -651,6 +651,25 @@ "md5sum": "cc1738b0326c9679453bdf1489ded483" } } + }, + "allow_invisible_models": { + "description": "Changing model to None will make it invisible instead of raising an exception.", + "external_url": "", + "authors": [ + { + "name": "Rikko", + "email": "rikkolovescats@proton.me", + "discord": "Rikko#7383" + } + ], + "versions": { + "1.0.0": { + "api_version": 7, + "commit_sha": "3221b3a", + "released_on": "22-01-2023", + "md5sum": "24913c665d05c3056c8ba390fe88155e" + } + } } } } \ No newline at end of file diff --git a/plugins/utilities/allow_invisible_models.py b/plugins/utilities/allow_invisible_models.py new file mode 100644 index 0000000..b2d1403 --- /dev/null +++ b/plugins/utilities/allow_invisible_models.py @@ -0,0 +1,15 @@ +# ba_meta require api 7 +import ba + +original_getmodel = ba.getmodel + + +def get_model_gracefully(model): + if model is not None: + return original_getmodel(model) + + +# ba_meta export plugin +class Main(ba.Plugin): + def on_app_running(self): + ba.getmodel = get_model_gracefully