Page MenuHome

EnumProperty fill dynamically using callback
Closed, InvalidPublic

Description

System Information
Not related (win 7)

Blender Version
2.78c hash e92f235283

Short description of error

I cannot describe it better : https://blender.stackexchange.com/questions/74453/enumproperty-fill-dynamically-using-callback

Exact steps for others to reproduce the error

  • Create a Debug Anchor (3D view --> Add --> Debug --> Anchor)
  • Create a Camera (or use an existing one)
  • Select the camera, in the Object properties, use the "Point of interest" panel to add an Anchor and choose an existing one
  • Create a new Debug Anchor
  • Check the camera POI panel : the anchor previously chosen has changed

Details

Type
Bug

Event Timeline

I don't see (3D view > Add > Debug ....)

I don't see (3D view > Add > Debug ....)

Sorry, I mean : Add/Create a new object (Add menu from the default view) --> Debug object --> Anchor object

Yah, I don't have that at all. I've never see anything related to 'debug' in the add menu.
Are you using some kind of debug build?

Yah, I don't have that at all. I've never see anything related to 'debug' in the add menu.
Are you using some kind of debug build?

I,
Sorry, I'm new to Blender's developer system, maybe my vocabulary is not good.
I just open the script and run it :

Brecht Van Lommel (brecht) closed this task as Invalid.
Brecht Van Lommel (brecht) claimed this task.

Blender stores enum properties as an integer internally. If you specify a list of items, the integer values will just be the location of the item in the list, which can change if you change the number of items. This is not considered a bug. Possible solutions are:

  • Explicitly specify an unique integer value for each item that you can guarantee stays the same, for example: ('NAME', 'Name', 'A description', 35)
  • Use a StringProperty instead, perhaps combined with prop_search to show a list of items in the UI.
  • In the upcoming Blender 2.79, PointerProperty will support pointing to datablocks (D113).
  • Explicitly specify an unique integer value for each item that you can guarantee stays the same, for example: ('NAME', 'Name', 'A description', 35)

Thanks !
I didn't know it could work this way !