diff options
author | Bastien Montagne <bastien@blender.org> | 2020-12-29 16:43:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-01-06 18:25:39 +0300 |
commit | 6672cbeb236444541037e728759792b1208df0da (patch) | |
tree | 9b5248e4566a601673fcc538e007d2e6f549795a /source/blender/editors/object/object_remesh.c | |
parent | a584aef4703aeefe0843f3b8aa2c1e863f825aef (diff) |
Fix T84202: Sculpt lasso mask crash after remesh.
'Caused'/revealed by rBd29a720c45e5: Operators that fully re-create the
mesh would previously rely on `sculpt_update_object` called from update
code to get required sculpt-specific data layers re-added to the new
mesh.
Now instead put all code adding data to orig mesh for sculpt purpose
into a new util function (`BKE_sculpt_ensure_orig_mesh_data`), and call
that function when entering sculpt mode, and from voxel remesher code.
This is contonuing effort to more clearly separate orig data from evaluated
data handling/usage in sculpt code.
TODO: there are likely other code paths that would need to call that
new function?
Reviewers: @sergey, @pablodp606
Subscribers:
Diffstat (limited to 'source/blender/editors/object/object_remesh.c')
-rw-r--r-- | source/blender/editors/object/object_remesh.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c index 058c34fb977..d560d347217 100644 --- a/source/blender/editors/object/object_remesh.c +++ b/source/blender/editors/object/object_remesh.c @@ -190,6 +190,7 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op) } if (ob->mode == OB_MODE_SCULPT) { + BKE_sculpt_ensure_orig_mesh_data(CTX_data_scene(C), ob); ED_sculpt_undo_geometry_end(ob); } @@ -645,6 +646,7 @@ typedef struct QuadriFlowJob { short *stop, *do_update; float *progress; + Scene *scene; int target_faces; int seed; bool use_mesh_symmetry; @@ -892,6 +894,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update } if (ob->mode == OB_MODE_SCULPT) { + BKE_sculpt_ensure_orig_mesh_data(qj->scene, ob); ED_sculpt_undo_geometry_end(ob); } @@ -935,6 +938,7 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op) QuadriFlowJob *job = MEM_mallocN(sizeof(QuadriFlowJob), "QuadriFlowJob"); job->owner = CTX_data_active_object(C); + job->scene = CTX_data_scene(C); job->target_faces = RNA_int_get(op->ptr, "target_faces"); job->seed = RNA_int_get(op->ptr, "seed"); |