Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-10-16 23:24:26 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-10-16 23:24:26 +0300
commit25e84334f7d66b36ff962688c4c5b5818bd5db25 (patch)
tree7e62cda97862cae9b4fe7114d4d6f36ce8549fb5 /source/blender/blenkernel/BKE_paint.h
parent4c320e2639ef41f093a71f6843b40ab64bdd021b (diff)
Sculpt: Fix T101864: Mask initialization not updating multires data
BKE_sculpt_mask_layers_ensure now takes a depsgraph argument and will evaluate the depsgraph if a multires mask layer is added. This is necassary to update the multires runtime data so that pbvh knows it has a grids mask layer. Also added code to update pbvh->gridkey.
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r--source/blender/blenkernel/BKE_paint.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 5312292d431..557edddac2a 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -860,7 +860,18 @@ int *BKE_sculpt_face_sets_ensure(struct Mesh *mesh);
* (see #SCULPT_visibility_sync_all_from_faces).
*/
bool *BKE_sculpt_hide_poly_ensure(struct Mesh *mesh);
-int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd);
+
+/* Ensures a mask layer exists. If depsgraph and bmain are non-null,
+ * a mask doesn't exist and the object has a multiresolution modifier
+ * then the scene depsgraph will be evaluated to update the runtime
+ * subdivision data.
+ *
+ * Note: always call *before* BKE_sculpt_update_object_for_edit.
+ */
+int BKE_sculpt_mask_layers_ensure(struct Depsgraph *depsgraph,
+ struct Main *bmain,
+ struct Object *ob,
+ struct MultiresModifierData *mmd);
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene);
struct PBVH *BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob);