I'm looking for a way to have a dynamic amount of string properties. currently I have setup an array which appends a bunch of string properties to a list, this is all fine and well except i can't place the property in the layout due to it not having an identifier (well not that i know of).
for _ in self.MATERIAL_LIST:
self.TEXTURE_PROPERTIES.append(props.StringProperty(name=_, description='{} texture'.format(_)))
imageBox.prop(self.properties, 'TEXTURE_PROPERTIES')
above you can see I have a Material list which is a list of all the names of the materials
I wish to place each elemt of the array in a UIlayout box called 'imageBox' any help is appreciated and even alternative or more efficent ideas would be appreciated.
EDIT:imageBox.prop(self.properties, 'TEXTURE_PROPERTIES')
causes an error as TEXTURE_PROPERTIES property cannot be found
imageBox.prop(self.TEXTURE_PROPERTIES, 'prop1')but if i had something like
self.TEXTURE_PROPERTIES.__annotations__['mat_0'] = props.StringProperty(name = 'Material 0')imageBox.prop(self.TEXTURE_PROPERTIES, 'mat_0')I have no success
,also if I define the annotations in the class and not later I have no problems
– Michael Holmes Nov 02 '20 at 08:06