Fix #103410: name collisions between vertex groups and attributes #109910

Merged
Philipp Oeser merged 8 commits from lichtwerk/blender:103410 into main 2023-08-08 10:11:18 +02:00

8 Commits

Author SHA1 Message Date
Philipp Oeser 004ff868d7 cast from ob data to ID
avoids a distinction in `defgroup_find_name_dupe`
2023-08-08 09:59:20 +02:00
Philipp Oeser 05b1d2cce4 Merge branch 'main' into 103410 2023-08-08 09:54:25 +02:00
Philipp Oeser d410b82721 address review 2023-07-15 13:46:44 +02:00
Philipp Oeser abfd99b950 adress review 2023-07-14 15:28:42 +02:00
Philipp Oeser 181bf71a18 Merge branch 'main' into 103410 2023-07-14 14:58:45 +02:00
Philipp Oeser 93eca802fd remove unneccessary include 2023-07-14 13:17:46 +02:00
Philipp Oeser 9361ad5f19 Unify into a single callback 2023-07-14 13:04:29 +02:00
Philipp Oeser b8fe121037 Fix #103410: name collisions between vertex groups and attributes
These name collisions should be avoided with customdata, all sorts of
issues can arise from those.
We already warned in the attributes (but not the vertex groups) list if
those were found.
Previously, creating a vertex group with the same name as an already
existing attribute would allow this (and give said warning).
Previously, creating an attribute with the same name as an already
existing vertex group would silently fail (as in: dont return a layer)
-- and then due to an oversight in 101d04f41f (which assumed a valid
layer would always be returned by `BKE_id_attribute_new` and would
access stuff in the NULL layer) would even crash.

Now name collisions between vertex groups and attributes are handled by
ensuring unique names correctly.
This is done by running `BLI_uniquename_cb` twice (onnce for attributes
and once for vertex groups) -- doing this in one callback is probably
not possible since we would run into recursive infinite loops between the
two (at least afaict).
2023-07-10 14:57:00 +02:00