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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-01-02 13:26:31 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-01-02 13:26:31 +0300
commitf15205b93f56e454b76d5a222fdb9a9665b99907 (patch)
tree7fb5ac79e5b62399c9e476f3efde7704beb7dad7 /source/blender/editors/object/object_modifier.c
parent39e0bfe5a29de631b81303d24dd5e397ead60705 (diff)
Fix T60060: Corrective Smooth Modifier binding process is broken.
Same as with the other modifiers' binding ops, those need to be performed outside of regular depsgraph eval.
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r--source/blender/editors/object/object_modifier.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 2be86773057..15aca6a3253 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1880,6 +1880,7 @@ static bool correctivesmooth_poll(bContext *C)
static int correctivesmooth_bind_exec(bContext *C, wmOperator *op)
{
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)edit_modifier_property_get(op, ob, eModifierType_CorrectiveSmooth);
@@ -1906,9 +1907,16 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op)
else {
/* signal to modifier to recalculate */
csmd->bind_coords_num = (unsigned int)-1;
+
+ /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */
+ const int mode = csmd->modifier.mode;
+ csmd->modifier.mode |= eModifierMode_Realtime;
+ object_force_modifier_update_for_bind(depsgraph, scene, ob);
+ csmd->modifier.mode = mode;
}
- DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+ /* We need ID_RECALC_COPY_ON_WRITE to ensure (un)binding is flushed to CoW copies of the object... */
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
return OPERATOR_FINISHED;