Fix #105152: Removing color attribute doesn't update active #105871

Manually merged
Brecht Van Lommel merged 6 commits from bonj/blender:fix/remove-color-attribute into main 2023-03-19 10:28:23 +01:00

6 Commits

Author SHA1 Message Date
Jorijn de Graaf a6712399c0 Merge branch 'main' into fix/remove-color-attribute 2023-03-18 22:49:31 +01:00
Jorijn de Graaf 09d0349c43 Invert attribute remove check and use early return
This way the rest of the code can be tabbed back once.
2023-03-18 22:48:14 +01:00
Jorijn de Graaf f3be034b63 Remove next_color_attribute utilities
These utility functions are no longer used.
2023-03-18 22:43:58 +01:00
Jorijn de Graaf 395ae6a504 Use utility functions to restore color attributes
I think this is a lot cleaner.
Also the index is clamped now so deleting the last item in the list works too.
2023-03-18 19:12:56 +01:00
Jorijn de Graaf 9ecb895c92 Don't use next_color_attribute
BKE_id_attribute_remove handles this now, so there's no need to do it here.
2023-03-18 04:12:57 +01:00
Jorijn de Graaf 10ab93a095 Restore active/default color attribute using index
Find the indices for the active and default color attributes, remove the chosen attribute, find the color attributes that go with those indices now, and make them active/default.
This code is not exactly elegant but it does work.
A utility function would be nice, instead of copy pasting the same code several times.
But it's late and this is good enough for a proof of concept.
2023-03-18 04:10:22 +01:00