[Bf-python] capture enum value

Campbell Barton ideasman42 at gmail.com
Wed May 25 16:19:07 CEST 2011


At the moment py enums are very limited - they can only be a fixed
list of items,

Eventually they will be allowed to be dynamic like in C where you can
generate the list on the fly, its one of my TODO's.

You can cheat by creating a menu and referencing that from the UI, eg:
   layout.menu("SOME_MT_dynamic_menu")

This menu will use the draw function so it can be dynamic, the issue
then is that you need to have an operator on each menu item, this
operator can do anything, and you may be able to define 1 operator and
just give each one different arguments (this is how the preset menu
works).

2011/5/23 Yuniel Castro González <ycastrog at estudiantes.uci.cu>:
> Hi to all.
> I am programming a script and I have a enum (combobox) containing the names of some listings, but I need to capture the value of the enum to execute an action with that value.
> How can I do?
> Thanks in advance.
>
> --
>
>
>
>
>
>
>
>
> Yuniel
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list