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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
- Branch
- py-bmop-enums (branched from blender2.8)
- Build Status
Buildable 1941 Build 1941: arc lint + arc unit
Event Timeline
Comment Actions
- 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
Comment Actions
- update docs generation for BMO_FlagSet and to allow flags and enums
- fix default value of BMOp flag slot
Comment Actions
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 | ||
|---|---|---|
| 280 | would make this general axis enum to be reused. | |
| 1205 | *picky* would put these on own line (single tab indent) avoids right shift or misalignment on batch renaming. | |
| 1205–1208 | Cant this use enum values? | |
Comment Actions
- Rename axis enum
- Assert equal size of PyC_FlagSet and BMO_FlagSet
- Rename and reformat enums
- Convert remaining enums from ints
- Cleanup docstrings
| 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. | |