rigidbody: Add missing updates for rigidbody operators

Fixes cache not being invalidated when using change collision shape and
calculate mass operators.
This commit is contained in:
2013-02-09 10:04:29 +00:00
parent 4479d13236
commit bd9a7ab768

View File

@@ -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;