Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 1,755 Lines • ▼ Show 20 Lines | 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; | ||||
| } | } | ||||
| if (ob->runtime.geometry_set_eval != NULL) { | if (ob->runtime.geometry_set_eval != NULL) { | ||||
| BKE_geometry_set_free(ob->runtime.geometry_set_eval); | BKE_geometry_set_free(ob->runtime.geometry_set_eval); | ||||
| ob->runtime.geometry_set_eval = NULL; | ob->runtime.geometry_set_eval = NULL; | ||||
| } | } | ||||
| if (ob->runtime.geometry_set_preview != NULL) { | if (ob->runtime.geometry_set_previews != NULL) { | ||||
| BKE_geometry_set_free(ob->runtime.geometry_set_preview); | BLI_ghash_free(ob->runtime.geometry_set_previews, NULL, (GHashValFreeFP)BKE_geometry_set_free); | ||||
| ob->runtime.geometry_set_preview = NULL; | ob->runtime.geometry_set_previews = NULL; | ||||
| } | } | ||||
| } | } | ||||
| void BKE_object_free_caches(Object *object) | void BKE_object_free_caches(Object *object) | ||||
| { | { | ||||
| short update_flag = 0; | short update_flag = 0; | ||||
| /* Free particle system caches holding paths. */ | /* Free particle system caches holding paths. */ | ||||
| Show All 36 Lines | void BKE_object_free_caches(Object *object) | ||||
| * guaranteed to be in a known state. | * guaranteed to be in a known state. | ||||
| */ | */ | ||||
| if (update_flag != 0) { | if (update_flag != 0) { | ||||
| DEG_id_tag_update(&object->id, update_flag); | DEG_id_tag_update(&object->id, update_flag); | ||||
| } | } | ||||
| } | } | ||||
| /* Can be called from multiple threads. */ | /* Can be called from multiple threads. */ | ||||
| void BKE_object_set_preview_geometry_set(Object *ob, struct GeometrySet *geometry_set) | void BKE_object_preview_geometry_set_add(Object *ob, | ||||
| const uint64_t key, | |||||
| struct GeometrySet *geometry_set) | |||||
| { | { | ||||
| static ThreadMutex mutex = BLI_MUTEX_INITIALIZER; | static ThreadMutex mutex = BLI_MUTEX_INITIALIZER; | ||||
| BLI_mutex_lock(&mutex); | BLI_mutex_lock(&mutex); | ||||
| if (ob->runtime.geometry_set_preview != NULL) { | if (ob->runtime.geometry_set_previews == NULL) { | ||||
| BKE_geometry_set_free(ob->runtime.geometry_set_preview); | ob->runtime.geometry_set_previews = BLI_ghash_int_new(__func__); | ||||
| } | } | ||||
| ob->runtime.geometry_set_preview = geometry_set; | BLI_ghash_reinsert(ob->runtime.geometry_set_previews, | ||||
| POINTER_FROM_UINT(key), | |||||
| geometry_set, | |||||
| NULL, | |||||
| (GHashValFreeFP)BKE_geometry_set_free); | |||||
| BLI_mutex_unlock(&mutex); | BLI_mutex_unlock(&mutex); | ||||
| } | } | ||||
| /** | /** | ||||
| * Actual check for internal data, not context or flags. | * Actual check for internal data, not context or flags. | ||||
| */ | */ | ||||
| bool BKE_object_is_in_editmode(const Object *ob) | bool BKE_object_is_in_editmode(const Object *ob) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 3,869 Lines • Show Last 20 Lines | |||||