Page MenuHome

Fix T78242: Crash when using a Sculpt color tools that needs connectivity for the first time
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Fri, Jun 26, 9:08 PM.



When there is no color layer available,
BKE_sculpt_update_object_for_edit creates a new one and tags the mesh
with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the
tool starts. This also deletes the PBVH and when it is created again in
BKE_sculpt_update_object_after_eval, the pmap is not initialized, making
the tool crash.

Most of the tools need the pmap, so I would rather have it always
initialized and remove all checks for pmap all over the code, (also,
multires and dyntopo have connectivity info always available), but I'm
not sure how doing this will affect performance/memory ussage. For now,
this always request the connectivity info when updating objects after
eval, so this should not happen again.

Diff Detail

rB Blender
T78242 (branched from master)
Build Status
Buildable 8735
Build 8735: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Fri, Jun 26, 9:08 PM
Pablo Dobarro (pablodp606) created this revision.

To me it seems that the actual source of problem is that BKE_sculpt_update_object_for_edit() leaves object in a non-consistent state, despite the fact that it is expected that PBVH and session should be fully usable after the call of this function. It also feels a wrong place to perform object modifications.

Agree, this is working around the problem and the fix should address the cause directly.