Page MenuHome

Fix T98673: Crash when adding color attribute in edit mode
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Jun 9 2022, 11:16 AM.

Details

Summary

Caused by rB3d5f5c2d9a5f: Color Attributes: Add initial fill color option.

We cannot fill initial color in editmode since attributes point to bmesh
customdata, the attribute data is NULL since custom data is stored per
element instead of a single array there and there is no attribute API
for bmesh.

Questions are:

  • do we disable the whole adding of color attributes in editmode because

of that?

  • or just grey out the color (using uiLayoutSetEnabled), also dont

try to fill it of course?

  • and explain in the tooltip this is disabled in editmode, using

UI_but_disable with a disabled_hint?

  • or use poll_property to hide the color completely in editmode (also

dont try to fill it of course)?

This patch just does the second option (without the disabled hint)

Diff Detail

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

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Jun 9 2022, 11:16 AM
Philipp Oeser (lichtwerk) created this revision.
Philipp Oeser (lichtwerk) planned changes to this revision.Jun 10 2022, 11:00 AM

We cannot fill initial color in editmode since attributes point to bmesh
customdata, the attribute data is NULL since custom data is stored per
element instead of a single array there and there is no attribute API
for bmesh.

Talked to @Hans Goudey (HooglyBoogly) and apparently this can be done still (just more annoying), will check on this though

I tried out the patch. It still results in crashes sometimes but I need to more time reproduce it.

IMO this would be fine as a temporary fix but we should support adding color attributes in Edit Mode.
@Joseph Eagar (joeedh) @Hans Goudey (HooglyBoogly) Maybe you have some ideas on how we should handle this?