Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 1,736 Lines • ▼ Show 20 Lines | void BKE_object_free_derived_caches(Object *ob) | ||||
| /* Restore initial pointer for copy-on-write datablocks, object->data | /* Restore initial pointer for copy-on-write datablocks, object->data | ||||
| * might be pointing to an evaluated datablock data was just freed above. */ | * might be pointing to an evaluated datablock data was just freed above. */ | ||||
| if (ob->runtime.data_orig != NULL) { | if (ob->runtime.data_orig != NULL) { | ||||
| ob->data = ob->runtime.data_orig; | ob->data = ob->runtime.data_orig; | ||||
| } | } | ||||
| BKE_object_to_mesh_clear(ob); | BKE_object_to_mesh_clear(ob); | ||||
| BKE_object_to_curve_clear(ob); | |||||
| BKE_object_free_curve_cache(ob); | BKE_object_free_curve_cache(ob); | ||||
| /* Clear grease pencil data. */ | /* Clear grease pencil data. */ | ||||
| if (ob->runtime.gpd_eval != NULL) { | if (ob->runtime.gpd_eval != NULL) { | ||||
| BKE_gpencil_eval_delete(ob->runtime.gpd_eval); | BKE_gpencil_eval_delete(ob->runtime.gpd_eval); | ||||
| ob->runtime.gpd_eval = NULL; | ob->runtime.gpd_eval = NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,299 Lines • ▼ Show 20 Lines | |||||
| void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag)) | void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag)) | ||||
| { | { | ||||
| Object_Runtime *runtime = &object->runtime; | Object_Runtime *runtime = &object->runtime; | ||||
| runtime->data_eval = NULL; | runtime->data_eval = NULL; | ||||
| runtime->gpd_eval = NULL; | runtime->gpd_eval = NULL; | ||||
| runtime->mesh_deform_eval = NULL; | runtime->mesh_deform_eval = NULL; | ||||
| runtime->curve_cache = NULL; | runtime->curve_cache = NULL; | ||||
| runtime->object_as_temp_mesh = NULL; | runtime->object_as_temp_mesh = NULL; | ||||
| runtime->object_as_temp_curve = NULL; | |||||
| runtime->geometry_set_eval = NULL; | runtime->geometry_set_eval = NULL; | ||||
| } | } | ||||
| /** | /** | ||||
| * Find an associated armature object. | * Find an associated armature object. | ||||
| */ | */ | ||||
| static Object *obrel_armature_find(Object *ob) | static Object *obrel_armature_find(Object *ob) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (object->runtime.object_as_temp_mesh == NULL) { | if (object->runtime.object_as_temp_mesh == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| BKE_id_free(NULL, object->runtime.object_as_temp_mesh); | BKE_id_free(NULL, object->runtime.object_as_temp_mesh); | ||||
| object->runtime.object_as_temp_mesh = NULL; | 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) | void BKE_object_check_uuids_unique_and_report(const Object *object) | ||||
| { | { | ||||
| BKE_pose_check_uuids_unique_and_report(object->pose); | BKE_pose_check_uuids_unique_and_report(object->pose); | ||||
| BKE_modifier_check_uuids_unique_and_report(object); | BKE_modifier_check_uuids_unique_and_report(object); | ||||
| } | } | ||||
| void BKE_object_modifiers_lib_link_common(void *userData, | void BKE_object_modifiers_lib_link_common(void *userData, | ||||
| struct Object *ob, | struct Object *ob, | ||||
| Show All 10 Lines | |||||