diff options
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 9b5a1614dc0..04071282a52 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1742,6 +1742,7 @@ void BKE_object_free_derived_caches(Object *ob) } BKE_object_to_mesh_clear(ob); + BKE_object_to_curve_clear(ob); BKE_object_free_curve_cache(ob); /* Clear grease pencil data. */ @@ -5057,6 +5058,7 @@ void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag)) runtime->mesh_deform_eval = NULL; runtime->curve_cache = NULL; runtime->object_as_temp_mesh = NULL; + runtime->object_as_temp_curve = NULL; runtime->geometry_set_eval = NULL; } @@ -5615,6 +5617,24 @@ void BKE_object_to_mesh_clear(Object *object) object->runtime.object_as_temp_mesh = NULL; } +Curve *BKE_object_to_curve(Object *object, Depsgraph *depsgraph, bool apply_modifiers) +{ + BKE_object_to_curve_clear(object); + + Curve *curve = BKE_curve_new_from_object(object, depsgraph, apply_modifiers); + object->runtime.object_as_temp_curve = curve; + return curve; +} + +void BKE_object_to_curve_clear(Object *object) +{ + if (object->runtime.object_as_temp_curve == NULL) { + return; + } + BKE_id_free(NULL, object->runtime.object_as_temp_curve); + object->runtime.object_as_temp_curve = NULL; +} + void BKE_object_check_uuids_unique_and_report(const Object *object) { BKE_pose_check_uuids_unique_and_report(object->pose); |