I’d like to maintain a scene variable or property that is a simple list of strings. The length and elements of the list might change, but there is only one such list in the scene, and I’d like to be able to interact with it as a Python list. What is the best way to do this in Blender?
Technically I can do what I need with a CollectionProperty() object, as below, but this is ridiculous as all I want is a list (and declaring bpy.types.Scene.filepaths = [] at registration creates a read-only object).
Desired behavior:
my_python_list = create_list_function()
bpy.types.Scene.filepaths = my_python_list
n = len(bpy.types.Scene.filepaths)
elt = bpy.types.Scene.filepaths[ind]
bpy.types.Scene.filepaths = my_new_python_list
etc…
Workaround I’m trying to avoid:
class FileNameItem(bpy.types.PropertyGroup):
filename = bpy.props.StringProperty()
index = bpy.props.IntProperty()
bpy.types.Scene.filepaths = CollectionProperty(type=FileNameItem) # really just want a list of strings
Thanks in advance!