Fix T56500: Origin to geometry crashes on armature

Reviewers: sergey

https://developer.blender.org/D3639
This commit is contained in:
Dalai Felinto 2018-08-22 17:02:37 -03:00
parent 2dafc39d56
commit 25c918196c
Notes: blender-bot 2023-02-14 05:24:36 +01:00
Referenced by issue #56500, Origin to geometry, to cursor, to center of mass, etc with bones make Blender crashing
3 changed files with 14 additions and 8 deletions

View File

@ -308,6 +308,8 @@ struct MovieClip *BKE_object_movieclip_get(struct Scene *scene, struct Object *o
void BKE_object_runtime_reset(struct Object *object);
void BKE_object_batch_cache_dirty(struct Object *ob);
/* this function returns a superset of the scenes selection based on relationships */
typedef enum eObRelationTypes {

View File

@ -302,14 +302,8 @@ void BKE_object_eval_uber_transform(Depsgraph *depsgraph, Object *object)
BKE_object_eval_proxy_copy(depsgraph, object);
}
void BKE_object_eval_uber_data(Depsgraph *depsgraph,
Scene *scene,
Object *ob)
void BKE_object_batch_cache_dirty(Object *ob)
{
DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
BLI_assert(ob->type != OB_ARMATURE);
BKE_object_handle_data_update(depsgraph, scene, ob);
switch (ob->type) {
case OB_MESH:
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
@ -331,6 +325,16 @@ void BKE_object_eval_uber_data(Depsgraph *depsgraph,
}
}
void BKE_object_eval_uber_data(Depsgraph *depsgraph,
Scene *scene,
Object *ob)
{
DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
BLI_assert(ob->type != OB_ARMATURE);
BKE_object_handle_data_update(depsgraph, scene, ob);
BKE_object_batch_cache_dirty(ob);
}
void BKE_object_eval_cloth(Depsgraph *depsgraph,
Scene *scene,
Object *object)

View File

@ -1216,7 +1216,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
for (tob = bmain->object.first; tob; tob = tob->id.next) {
if (tob->data && (((ID *)tob->data)->tag & LIB_TAG_DOIT)) {
BKE_mesh_batch_cache_dirty(tob->data, BKE_MESH_BATCH_DIRTY_ALL);
BKE_object_batch_cache_dirty(tob);
DEG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA);
}
}