diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-28 12:22:47 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-28 12:22:47 +0300 |
commit | be7ce7cb4d7f4b28fffc626e6ac0b3588a5824e3 (patch) | |
tree | 4666e9309a3b59f711e5cac6109371b1d0a0c0d6 /source/blender/editors/space_view3d/space_view3d.c | |
parent | 8761699eab62eaba0f25f3d3ca1ce5d722c9fa45 (diff) |
View3D Context: use correct data type
`CTX_data_selected_objects()` returns a `ListBase` of
`CollectionPointerLink`, not `PointerRNA`. This caused an alignment
issue, resulting in `owner_id == NULL` reported in T92507. Correcting
the pointer type fixed this.
In the end, the same pointer is used as before this commit, but the way
it is obtained is actually correct.
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 37d013e7bd9..6acf51aec6e 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1821,8 +1821,8 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes if (CTX_data_equals(member, "selected_ids")) { ListBase selected_objects; CTX_data_selected_objects(C, &selected_objects); - LISTBASE_FOREACH (PointerRNA *, object_ptr, &selected_objects) { - ID *selected_id = object_ptr->data; + LISTBASE_FOREACH (CollectionPointerLink *, object_ptr_link, &selected_objects) { + ID *selected_id = object_ptr_link->ptr.owner_id; CTX_data_id_list_add(result, selected_id); } BLI_freelistN(&selected_objects); |