EnumProperty weird behavior using ENUM_FLAG option with number items argument #52090

Closed
opened 2017-07-17 13:17:56 +02:00 by Mikhail Rachinskiy · 6 comments

System Information
Windows 10 x64
Renderer: GeForce GTX 860M/PCIe/SSE2

Blender Version
Broken: 2.78.5 c2d285f

Short description of error
EnumProperty shows weird behavior when using ENUM_FLAG option along with number items argument.

Exact steps for others to reproduce the error

  • Open attached blend file: enum_flag.blend
  • Run the script and locate Test panel in object properties area.
    • 1st case: when items number is 0, it won't select.
    • 2nd case: when item's number increment from 1, 3rd element affects the state of other elements
    • 3rd case: if item's number increment from 1, but 3 is skipped, enum works OK
    • 4th case: if there is no number arguments, enum works OK

5th case has nothing to do with the bug report, but is there a reason why item's icon argument requires the number argument?

**System Information** Windows 10 x64 Renderer: GeForce GTX 860M/PCIe/SSE2 **Blender Version** Broken: 2.78.5 c2d285f **Short description of error** `EnumProperty` shows weird behavior when using `ENUM_FLAG` option along with `number` items argument. **Exact steps for others to reproduce the error** - Open attached blend file: [enum_flag.blend](https://archive.blender.org/developer/F669884/enum_flag.blend) - Run the script and locate Test panel in object properties area. - 1st case: when items `number` is 0, it won't select. - 2nd case: when item's `number` increment from 1, 3rd element affects the state of other elements - 3rd case: if item's `number` increment from 1, but 3 is skipped, enum works OK - 4th case: if there is no `number` arguments, enum works OK 5th case has nothing to do with the bug report, but is there a reason why item's `icon` argument requires the `number` argument?
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy

This issue was referenced by blender/blender@d268cad06a

This issue was referenced by blender/blender@d268cad06a5207d63ff10026eeb09fe450282a01

Added subscriber: @brecht

Added subscriber: @brecht

I updated the documentation to describe the reason for this behavior, the numbers must be powers of two:

The icon argument being required is indeed not great, for historical reasons a tuple of size 4 expects a number instead of an icon. Maybe it should have been the other way around, but like the powers of two requirement that would mean breaking backwards compatibility.

I updated the documentation to describe the reason for this behavior, the numbers must be powers of two: The icon argument being required is indeed not great, for historical reasons a tuple of size 4 expects a number instead of an icon. Maybe it should have been the other way around, but like the powers of two requirement that would mean breaking backwards compatibility.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#52090
No description provided.