Page MenuHome

Implement BMesh Operator string enumerators and docs generation.

Authored by Andrew Hale (trumanblending) on Aug 22 2018, 1:32 PM.



BMesh operators previously required magic numbers for enumerators which was very opaque for users. This commit adds support for using string enumerators instead. This also provides doc generation for the new options. Implements T56496.

Diff Detail

rB Blender

Event Timeline

  • Add support for integer flags as well as enums
  • Add BMO_FlagSet to emulate PyC_FlagSet for enums and flags
  • Translate dissolve_limit as it uses flags instead of enums
  • update docs generation for BMO_FlagSet and to allow flags and enums
  • fix default value of BMOp flag slot

Generally LGTM: minor notes.

We could use common prefix for enum defines, eg:

  • bmo_enum_axis_xyz[] - reusable xyz axis.
  • bmo_enum_subdivide_edges_quad_corner_type - one off use for single bmesh operator.

This way names are verbose but don't get mixed up.


would make this general axis enum to be reused.


*picky* would put these on own line (single tab indent) avoids right shift or misalignment on batch renaming.


Cant this use enum values?

  • Rename axis enum
  • Assert equal size of PyC_FlagSet and BMO_FlagSet
  • Rename and reformat enums
  • Convert remaining enums from ints
  • Cleanup docstrings
Campbell Barton (campbellbarton) added inline comments.

can use ELEM(slot->slot_subtype.intg, BMO_OP_SLOT_SUBTYPE_INT_ENUM, BMO_OP_SLOT_SUBTYPE_INT_FLAG) here.

This revision is now accepted and ready to land.Aug 27 2018, 3:43 PM
This revision was automatically updated to reflect the committed changes.
Andrew Hale (trumanblending) marked 4 inline comments as done.