Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/displist.c
| Show First 20 Lines • Show All 1,766 Lines • ▼ Show 20 Lines | if (!for_orco) { | ||||
| } | } | ||||
| } | } | ||||
| if (!for_orco) { | if (!for_orco) { | ||||
| BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase); | BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase); | ||||
| curve_calc_modifiers_post(depsgraph, scene, ob, &nubase, dispbase, r_final, for_render); | 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); | curve_to_filledpoly(cu, &nubase, dispbase); | ||||
| } | } | ||||
| BKE_nurbList_free(&nubase); | BKE_nurbList_free(&nubase); | ||||
| } | } | ||||
| } | } | ||||
| void BKE_displist_make_curveTypes( | void BKE_displist_make_curveTypes( | ||||
| Show All 11 Lines | void BKE_displist_make_curveTypes( | ||||
| BKE_object_free_derived_caches(ob); | BKE_object_free_derived_caches(ob); | ||||
| if (!ob->runtime.curve_cache) { | if (!ob->runtime.curve_cache) { | ||||
| ob->runtime.curve_cache = MEM_callocN(sizeof(CurveCache), "CurveCache for curve types"); | ob->runtime.curve_cache = MEM_callocN(sizeof(CurveCache), "CurveCache for curve types"); | ||||
| } | } | ||||
| dispbase = &(ob->runtime.curve_cache->disp); | dispbase = &(ob->runtime.curve_cache->disp); | ||||
| do_makeDispListCurveTypes( | Mesh *mesh_eval = NULL; | ||||
| depsgraph, scene, ob, dispbase, for_render, for_orco, &ob->runtime.mesh_eval); | do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, for_render, for_orco, &mesh_eval); | ||||
| if (ob->runtime.mesh_eval != NULL) { | if (mesh_eval != NULL) { | ||||
| ob->runtime.mesh_eval->id.tag |= LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT; | BKE_object_eval_assign_data(ob, &mesh_eval->id, true); | ||||
| ob->runtime.is_mesh_eval_owned = true; | |||||
| } | } | ||||
| boundbox_displist_object(ob); | boundbox_displist_object(ob); | ||||
| } | } | ||||
| void BKE_displist_make_curveTypes_forRender(Depsgraph *depsgraph, | void BKE_displist_make_curveTypes_forRender(Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| Show All 39 Lines | if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { | ||||
| * here we only calculate object BB based on final display list. | * here we only calculate object BB based on final display list. | ||||
| */ | */ | ||||
| /* object's BB is calculated from final displist */ | /* object's BB is calculated from final displist */ | ||||
| if (ob->runtime.bb == NULL) { | if (ob->runtime.bb == NULL) { | ||||
| ob->runtime.bb = MEM_callocN(sizeof(BoundBox), "boundbox"); | ob->runtime.bb = MEM_callocN(sizeof(BoundBox), "boundbox"); | ||||
| } | } | ||||
| if (ob->runtime.mesh_eval) { | Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); | ||||
| BKE_object_boundbox_calc_from_mesh(ob, ob->runtime.mesh_eval); | if (mesh_eval) { | ||||
| BKE_object_boundbox_calc_from_mesh(ob, mesh_eval); | |||||
| } | } | ||||
| else { | else { | ||||
| float min[3], max[3]; | float min[3], max[3]; | ||||
| INIT_MINMAX(min, max); | INIT_MINMAX(min, max); | ||||
| BKE_displist_minmax(&ob->runtime.curve_cache->disp, min, max); | BKE_displist_minmax(&ob->runtime.curve_cache->disp, min, max); | ||||
| BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max); | BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max); | ||||
| ob->runtime.bb->flag &= ~BOUNDBOX_DIRTY; | ob->runtime.bb->flag &= ~BOUNDBOX_DIRTY; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||