Page MenuHome

Fix T100687: Geometry Attribute Convert crashes in sculpt mode
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 1 2022, 1:56 PM.

Details

Summary

Since above commit, BKE_id_attributes_active_get would also return
"internal" attributes like ".hide_poly" or ".hide_vert.
As a consequence, a couple of poll functions dont return false anymore
(attribute remove, attribute convert), allowing these operators to
execute, but acting on this "internal" layers is just asking for
trouble.

In the UI, we dont see these attributes, because MESH_UL_attributes
checks is_internal, same thing we do now in
BKE_id_attributes_active_get.

Diff Detail

Repository
rB Blender
Branch
T100687 (branched from master)
Build Status
Buildable 23565
Build 23565: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Sep 1 2022, 1:56 PM
Philipp Oeser (lichtwerk) created this revision.
Hans Goudey (HooglyBoogly) accepted this revision.EditedSep 1 2022, 2:29 PM

Nice simple fix, thanks!
We'll probably have to make some code safer for when the attribute doesn't exist either way, but it makes sense that an "invisible" attribute can't be active.

Do you think BKE_id_attributes_active_set should be affected too?

This revision is now accepted and ready to land.Sep 1 2022, 2:29 PM

Do you think BKE_id_attributes_active_set should be affected too?

Saw this a bit late, but since now you cant get an attribute that is not valid via python, you wont be able to set it. Only other occurance seems to be from geometry_attribute_add_exec and that should not be an issue either.
In theory though: probably yes :)