Page MenuHome

Implement BMesh Operator string enumerators and docs generation.
ClosedPublic

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

Details

Summary

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

Repository
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.

source/blender/bmesh/intern/bmesh_opdefines.c
308

would make this general axis enum to be reused.

1254

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

1254–1257

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.
source/blender/bmesh/intern/bmesh_operators.c
144–145

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.