diff options
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 78f2b10305e..95be7f8f51f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -469,6 +469,7 @@ void BKE_object_free_derived_caches(Object *ob) ob->runtime.mesh_deform_eval = NULL; } + BKE_object_to_mesh_clear(ob); BKE_object_free_curve_cache(ob); /* clear grease pencil data */ @@ -4497,3 +4498,21 @@ void BKE_object_update_select_id(struct Main *bmain) ob = ob->id.next; } } + +Mesh *BKE_object_to_mesh(Object *object) +{ + BKE_object_to_mesh_clear(object); + + Mesh *mesh = BKE_mesh_new_from_object(object); + object->runtime.object_as_temp_mesh = mesh; + return mesh; +} + +void BKE_object_to_mesh_clear(Object *object) +{ + if (object->runtime.object_as_temp_mesh == NULL) { + return; + } + BKE_id_free(NULL, object->runtime.object_as_temp_mesh); + object->runtime.object_as_temp_mesh = NULL; +} |