Fix crash on Multires Face Set visibility sync

Multires uses the data of the Face Sets stored in the base mesh to
manage the grid's visibility, so these pointers can no longer be set to
NULL when editing Multires objects as they are requried for some operations.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7431
This commit is contained in:
Pablo Dobarro 2020-04-20 02:06:12 +02:00 committed by Pablo Dobarro
parent d290bdd42a
commit 35cbf3b5dc
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #75748, Entering Sculpt mode after using Multires Subdivide crashes Blender
4 changed files with 14 additions and 5 deletions

@ -1 +1 @@
Subproject commit cc1a2f5af8681158905be040099ea14bb814b331
Subproject commit f12430cae606db8aeeb72f99fe15ebbd71d4a92c

View File

@ -294,10 +294,15 @@ typedef struct SculptSession {
struct MultiresModifierData *modifier;
int level;
} multires;
/* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */
struct MVert *mvert;
struct MPoly *mpoly;
struct MLoop *mloop;
/* These contain the vertex and poly counts of the final mesh. */
int totvert, totpoly;
struct KeyBlock *shapekey_active;
float *vmask;
@ -306,6 +311,7 @@ typedef struct SculptSession {
int *pmap_mem;
/* Mesh Face Sets */
/* Total number of polys of the base mesh. */
int totfaces;
int *face_sets;

View File

@ -1514,9 +1514,12 @@ static void sculpt_update_object(
ss->totvert = me_eval->totvert;
ss->totpoly = me_eval->totpoly;
ss->totfaces = me->totpoly;
ss->mvert = NULL;
ss->mpoly = NULL;
ss->mloop = NULL;
/* These are assigned to the base mesh in Multires. This is needed because Face Sets operators
* and tools use the Face Sets data from the base mesh when Multires is active. */
ss->mvert = me->mvert;
ss->mpoly = me->mpoly;
ss->mloop = me->mloop;
}
else {
ss->totvert = me->totvert;

@ -1 +1 @@
Subproject commit 35dd27ded664b1068e773c27988ee221f3ce39d9
Subproject commit 8a36c2833db48ed78c436ee19534ce5cf3b2eeee