Hi, I’ve been working on a Blender plugin for some time now, the plugin itself to serve as a level editor for a game I’ve been modding utilizing Blender’s workflow. Of course, this requires a way to select an object to add, and because large enums don’t work too well, I opted to use a collection list to hold all of the 600+ entries. This works fine and all, but the issue comes with populating the list itself, where I can’t seem to find a straight-forward way.
Currently, I use an operator to do so, but this feels a bit hacky and I would like to imagine there is a better way. The operator code is as follows:
def execute(self, context):
for data in OBJECTS_LIST.values():
item = context.scene.object_list.add()
item.name = data.get("name", "")
item.model = data.get("model", "")
item.key = data.get("key", "")
return {'FINISHED'}
I would like a more elegant, function contained solution opposed to calling an operator on registration, as that can be a bit tricky to keep track of when reloading scenes. I’ll continue with that method for now, I guess
Thank you so much for the reply! The collection is meant to store a predefined list of items, basically serving as an enum but without the issues that lengthy enums run into. Notably enums lack a scroll bar and start creating new columns