diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-02-09 14:04:29 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-02-09 14:04:29 +0400 |
commit | bd9a7ab7688edab142e4c503726f17131153e26a (patch) | |
tree | 08a8fd6b5884097966f9fb0038f534665a1005f2 /source | |
parent | 4479d1323656a6d4c9374520e055edf8c7b497f5 (diff) |
rigidbody: Add missing updates for rigidbody operators
Fixes cache not being invalidated when using change collision shape and
calculate mass operators.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/physics/rigidbody_object.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index fa258c98567..9ce4656d4cd 100644 --- a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -338,12 +338,14 @@ static int rigidbody_obs_shape_change_exec(bContext *C, wmOperator *op) /* use RNA-system to change the property and perform all necessary changes */ RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr); RNA_enum_set(&ptr, "collision_shape", shape); + + DAG_id_tag_update(&ob->id, OB_RECALC_OB); } } CTX_DATA_END; /* send updates */ - WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); // XXX: wrong notifiers for now, but these also do the job... + WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL); /* done */ return OPERATOR_FINISHED; @@ -584,12 +586,14 @@ static int rigidbody_obs_calc_mass_exec(bContext *C, wmOperator *op) /* use RNA-system to change the property and perform all necessary changes */ RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr); RNA_float_set(&ptr, "mass", mass); + + DAG_id_tag_update(&ob->id, OB_RECALC_OB); } } CTX_DATA_END; /* send updates */ - WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); // XXX: wrong notifiers for now, but these also do the job... + WM_event_add_notifier(C, NC_OBJECT | ND_POINTCACHE, NULL); /* done */ return OPERATOR_FINISHED; |