Allow invisible models

This commit is contained in:
Rikko 2023-01-22 15:34:19 +05:30
parent 21a81a67d1
commit 3221b3a567
2 changed files with 30 additions and 1 deletions

View file

@ -651,6 +651,20 @@
"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": null
}
}
}
}

View file

@ -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