diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-12-14 13:40:33 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-12-14 13:45:54 +0300 |
commit | dc4c1be1a4455e84d1f72ce2703ab7425152965c (patch) | |
tree | 1bf2e689a0d68eae7a34d122b4d72ef96795dc3b /source/blender/blenkernel/intern/object_update.c | |
parent | 10508338d8813681f3aaeea3e9a41e91bd84cc15 (diff) |
New object API function : BKE_object_eval_reset()
This restores the object->data to a non-modifier evaluated state.
So this allow us to change evaluated object modifier stack directly and
get BKE_mesh_new_from_object() for the evalauted object.
Diffstat (limited to 'source/blender/blenkernel/intern/object_update.c')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 10bf6aed898..cbc67e23d66 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -69,6 +69,18 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" +/** + * Restore the object->data to a non-modifier evaluated state. + * + * Some changes done directly in evaluated object require them to be reset + * before being re-evaluated. + * For example, we need to call this before BKE_mesh_new_from_object(), + * in case we removed/added modifiers in the evaluated object. + **/ +void BKE_object_eval_reset(Object *ob_eval) +{ + BKE_object_free_derived_caches(ob_eval); +} void BKE_object_eval_local_transform(Depsgraph *depsgraph, Object *ob) { |