Fix #154078: Image & UV editor pie menu has missing entries

Despite being the same editor, using the same field, the python enum
string value differed between modes of the editor. This commit fixes the
problem by re-syncing the mapping between `pivot_items` and
`rna_enum_transform_pivot_full_items`

Note that this change is a minor breaking change for the `pivot_point`
field.
This commit is contained in:
Sean Kim 2026-02-10 16:58:04 +01:00 • committed by Sean Kim
parent c02e53ff48
commit 84ea75e808
2 changed files with 8 additions and 4 deletions

View file

@ -2195,9 +2195,9 @@ def km_image(params):
items.extend([
# Old pivot.
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS'},
{"properties": [("data_path", "space_data.pivot_point"), ("value", 'CENTER')]}),
{"properties": [("data_path", "space_data.pivot_point"), ("value", 'BOUNDING_BOX_CENTER')]}),
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", "space_data.pivot_point"), ("value", 'MEDIAN')]}),
{"properties": [("data_path", "space_data.pivot_point"), ("value", 'MEDIAN_POINT')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS'},
{"properties": [("data_path", "space_data.pivot_point"), ("value", 'CURSOR')]}),

View file

@ -2139,8 +2139,12 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/
bool * /*r_free*/)
{
static const EnumPropertyItem pivot_items[] = {
{V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
{V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
{V3D_AROUND_CENTER_BOUNDS,
"BOUNDING_BOX_CENTER",
ICON_PIVOT_BOUNDBOX,
"Bounding Box Center",
""},
{V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", ICON_PIVOT_MEDIAN, "Median Point", ""},
{V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
{V3D_AROUND_LOCAL_ORIGINS,
"INDIVIDUAL_ORIGINS",