Page MenuHome

Fix T70173: Ensure CD_MDISP when sculpting in Multires
Needs RevisionPublic

Authored by Pablo Dobarro (pablodp606) on Jan 24 2020, 3:20 AM.

Details

Summary

For some reason this file contains a Multirse Modifier whithout the MDISP datalayer. This was causing the BKE_sculpt_multires_active function to detect the modifier incorrectly, so it was starting the stroke with deform_modifiers_active set to true, when modifiers are not supported when sculpting on top of Multires. This was causing a crash when copying the undeformed coordintes when pushing a node to undo, as they weren't initialized.

Diff Detail

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

Event Timeline

Jeroen Bakker (jbakker) requested changes to this revision.Jan 28 2020, 1:11 PM

this change seems to much as a quick work-around, do we know the root cause. I don't like to add patches when the data of a single file got corrupted. Question is why did it get corrupted?

This revision now requires changes to proceed.Jan 28 2020, 1:11 PM

This affects other bugs in the tracker were the crash can be recreated from scratch (by applying modifiers on top of Multires), so maybe this is the intended way of doing it. This function is also initializing the mask datalayers for Multires and meshes if they don't exist, so I don't think there is another place to ensure that all the required datalayers exist before starting sculpt mode

this change seems to much as a quick work-around, do we know the root cause. I don't like to add patches when the data of a single file got corrupted. Question is why did it get corrupted?

This bug is not limited to a single example file; it can be created on the fly by following a a few steps from a new file, as outlined in the steps below:

I've found a way to reproduce this crash bug entirely from scratch with no required example file. To cause the bug to occur perform the following steps:

  1. Add a cube mesh object.
  2. Add a Mirror modifier to the cube object.
  3. Enable "Bisect: X" option in Mirror modifier.
  4. Enable "Clipping" option in Mirror modifier.
  5. Add a Multiresolution modifier to the cube object.
  6. Generate a subdivision level in the Multiresolution modifier (click the Subdivide button).
  7. Copy the cube object's Mirror modifier (click the Copy button).
  8. Apply the copied Mirror modifier (click the Apply button).
  9. Switch to Sculpt mode.
  10. Attempt to draw on the mesh using a sculpt brush (example: Draw brush).

Attempting to perform this list of task will cause Blender to crash instantly.