From f2b95b9eae2ee913c99cff7595527b18d8b49d0a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 27 Feb 2020 11:23:15 +0100 Subject: Objects: make evaluated data runtime storage usable for types other than mesh This is in preparation of new object types. This only changes mesh_eval, we may do the same for mesh_deform_eval and other areas in the future if there is a need for it. Differential Revision: https://developer.blender.org/D6695 --- source/blender/blenkernel/intern/displist.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/displist.c') diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 6d7d42b2293..6963f629798 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1772,7 +1772,7 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph, curve_calc_modifiers_post(depsgraph, scene, ob, &nubase, dispbase, r_final, for_render); } - if (cu->flag & CU_DEFORM_FILL && !ob->runtime.mesh_eval) { + if (cu->flag & CU_DEFORM_FILL && !ob->runtime.data_eval) { curve_to_filledpoly(cu, &nubase, dispbase); } @@ -1800,12 +1800,11 @@ void BKE_displist_make_curveTypes( dispbase = &(ob->runtime.curve_cache->disp); - do_makeDispListCurveTypes( - depsgraph, scene, ob, dispbase, for_render, for_orco, &ob->runtime.mesh_eval); + Mesh *mesh_eval = NULL; + do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, for_render, for_orco, &mesh_eval); - if (ob->runtime.mesh_eval != NULL) { - ob->runtime.mesh_eval->id.tag |= LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT; - ob->runtime.is_mesh_eval_owned = true; + if (mesh_eval != NULL) { + BKE_object_eval_assign_data(ob, &mesh_eval->id, true); } boundbox_displist_object(ob); @@ -1861,8 +1860,9 @@ static void boundbox_displist_object(Object *ob) ob->runtime.bb = MEM_callocN(sizeof(BoundBox), "boundbox"); } - if (ob->runtime.mesh_eval) { - BKE_object_boundbox_calc_from_mesh(ob, ob->runtime.mesh_eval); + Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); + if (mesh_eval) { + BKE_object_boundbox_calc_from_mesh(ob, mesh_eval); } else { float min[3], max[3]; -- cgit v1.2.3