I want to create some integer properties using loops just to save time and lines of code. So basically, the new properties should be something like this:
bpy.types.Scene.prop1
bpy.types.Scene.prop2
bpy.types.Scene.prop3
....
....
bpy.types.Scene.prop10
Here is my approach. First, I created a list of desired variables, "prop1...prop10".
prop_name = ["prop%d"%(i+1) for i in range(10)]
Then I use a for loop to create these properties.
for i, name in enumerate(prop_name):
bpy.types.Scene.name = bpy.props.IntProperty(name="prop %d"%(i+1))
With this, I expect 10 properties. Now I have 2 issue:
The name that should be shown inside the properties is not changing with respect to their index values.
2nd Issue: I'm not actually able to put them in my Panel. So, I guess, there are no properties created with this method.
(<built-in function Intproperty>, {'name':'prop10','attr':'name'})
(<built-in function Intproperty>, {'name':'prop10','attr':'name'})
(<built-in function Intproperty>, {'name':'prop10','attr':'name'})
(<built-in function Intproperty>, {'name':'prop10','attr':'name'})
How can I change this name with index value, or let me know if there is an another way to create multiple properties.