I want to be able to acces to chosen value (string) as well...
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
That is an Enum Property, essentially an array of options that have an identifying name, a displayed name, and a description (shown in the tooltip).
bpy.types.Scene.MyEnum = EnumProperty( items = [('one', 'One!', 'The first number'), ('two', 'Two', 'The second number'), ('three', 'Three', 'The third number')], default = "one", description = "Pick a number", name = "Numbers")
For the first item, "one" is the identifier, "One!" is the name shown in the interface, and "The first number" is shown in the tooltip.
You would access the chosen option using
scene.MyEnum, and set it using
To display the enum in the interface and allow the user to change it, use
Note: The code snippets here are very helpful :)