Page MenuHome

Painting: Applying Generative Modifiers
Needs RevisionPublic

Authored by Jeroen Bakker (jbakker) on Jun 6 2019, 1:13 PM.

Details

Summary

Recent changes on updating normals during sculpting broke the applying
modifiers when in weightpaint, vertex paint and texture painting.

It seems that the mpoly and mloop get special indexes (UINT_MAX,
SHORT_MAX) what leads to reading in unallocated memory.

This revision disables updating normals when the sculptsession is in
weight, vertex or texture painting. I haven't been able to detect the
root cause of this issue.

Diff Detail

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

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Jun 6 2019, 1:42 PM

Updating normals at this stage is probably unsafe in general. The sculpt session PBVH should be freed before the modifier is applied, or before any mesh changes that invalidate it really.

Or the normals update should happen somewhere else entirely.

This revision now requires changes to proceed.Jun 6 2019, 1:42 PM
  • also seems to crash here when applying generative modifiers during sculpting

I have tested several scenarios that crashes during the updating of normals when freeing pbvh:

I moved the updating of normals to sculptsession freeing function, but am not able to detect any noticeable differences. I am able to run the mentioned scenarios without any problem.
Before continuing I notices a memory leak during multi res sculpting. might be related. I will investigate the memleak first.

I've just removed this normal update code now, since it's only really needed to fix some corner cases.

Memory is supposed to "leak" until the number of undo steps is reached, not sure if that's what you're seeing or something else. But it seems sculpt does not respect the undo steps limit?