<div dir="ltr">Hello bf-python! This is my first time posting on this list.<div><br></div><div>I working on a plugin for Blender for some time now and I'm having some issues when using the EnumProperty object. My objective is to provide a drop-down menu for the user where he/she can select a given device from a list. I then want to retrieve the currently selected device and perform some initialization.</div><div><br></div><div>Well I managed to create the menu and populated it with my device list - which are strings, basically. But when the user select the device he wants, I can only access the string that is currently selected, and not the unique identifier of the string (such as an index). This can cause bugs on my plugin since I can have two devices with the same name. </div><div><br></div><div>One of my attempted solutions is using the "set" callback from the EnumProperties, that I can capture the "value" argument and use as an index. But there's one problem, as soon as I set a "set" callback function, the menu itself stop updating with the selected device, even though I receive the right value on my callback.</div><div><br></div><div>Here's a sample</div><div><br></div><div><div>        cls.device = EnumProperty(</div><div>                name="Device",</div><div>                description="Device to use for rendering",</div><div>                items=my_devices,</div><div>                set=set_my_device,</div><div>                )</div></div><div><br></div><div><div>def set_my_device(self, value):</div><div>    print("Device index is {0}".format(value))</div><div>    return None</div></div><div><br></div><div><br></div><div><br></div><div>I do receive the "Device index is X" with the right index, but the user interface does not change. I'm following the tutorial available on Property documentation [1], my guess is that I'm suppose to do something within the callback to get the right option to appear selected on Blender, but I don't know what it is.</div><div><br></div><div>Attached there's a minimal sample that you can copy and paste into blender to reproduce the problem. Button appears on the Render panel, below the  render button. I'm testing in 2.76b.</div><div><br></div><div>I stuck into this problem for some time and would really appreciate any help, or maybe some other solution to get the index from EnumProperty.</div><div><br></div><div>Henrique Jung</div><div><br></div><div>[1] <a href="https://www.blender.org/api/blender_python_api_current/bpy.props.html#get-set-example">https://www.blender.org/api/blender_python_api_current/bpy.props.html#get-set-example</a></div></div>