Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/displist.cc
| Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | |||||
| return curve_calc_modifiers_post(depsgraph, scene, ob, r_dispbase, for_render); | return curve_calc_modifiers_post(depsgraph, scene, ob, r_dispbase, for_render); | ||||
| } | } | ||||
| void BKE_displist_make_curveTypes(Depsgraph *depsgraph, | void BKE_displist_make_curveTypes(Depsgraph *depsgraph, | ||||
| const Scene *scene, | const Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| const bool for_render) | const bool for_render) | ||||
| { | { | ||||
| BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY, OB_FONT)); | BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY, OB_FONT)); | ||||
| Curve &cow_curve = *(Curve *)ob->data; | |||||
sergey: I'd call it `input_curve` (input as in input of the modifier stack), to not be confused with… | |||||
| BKE_object_free_derived_caches(ob); | BKE_object_free_derived_caches(ob); | ||||
| cow_curve.curve_eval = nullptr; | |||||
| ob->runtime.curve_cache = MEM_cnew<CurveCache>(__func__); | ob->runtime.curve_cache = MEM_cnew<CurveCache>(__func__); | ||||
| ListBase *dispbase = &ob->runtime.curve_cache->disp; | ListBase *dispbase = &ob->runtime.curve_cache->disp; | ||||
| if (ob->type == OB_SURF) { | if (ob->type == OB_SURF) { | ||||
| GeometrySet geometry = evaluate_surface_object(depsgraph, scene, ob, for_render, dispbase); | GeometrySet geometry = evaluate_surface_object(depsgraph, scene, ob, for_render, dispbase); | ||||
| ob->runtime.geometry_set_eval = new GeometrySet(std::move(geometry)); | ob->runtime.geometry_set_eval = new GeometrySet(std::move(geometry)); | ||||
| } | } | ||||
| else { | else { | ||||
| GeometrySet geometry = evaluate_curve_type_object(depsgraph, scene, ob, for_render, dispbase); | GeometrySet geometry = evaluate_curve_type_object(depsgraph, scene, ob, for_render, dispbase); | ||||
| if (geometry.has_curves()) { | |||||
| /* Assign the evaluated curve to the object's "data_eval". In addition to the curve_eval | |||||
| * added to the curve here, it will also contain a copy of the original curve's data. This is | |||||
| * essential, because it maintains the expected behavior for evaluated curve data from before | |||||
| * the CurveEval data type was introduced, when an evaluated object's curve data was just a | |||||
| * copy of the original curve and everything else ended up in #CurveCache. */ | |||||
| CurveComponent &curve_component = geometry.get_component_for_write<CurveComponent>(); | |||||
| cow_curve.curve_eval = curve_component.get_for_read(); | |||||
| BKE_object_eval_assign_data(ob, &cow_curve.id, false); | |||||
| } | |||||
| ob->runtime.geometry_set_eval = new GeometrySet(std::move(geometry)); | ob->runtime.geometry_set_eval = new GeometrySet(std::move(geometry)); | ||||
Done Inline ActionsThis comment should be updated, it still mentions CurveEval. JacquesLucke: This comment should be updated, it still mentions `CurveEval`. | |||||
| } | } | ||||
| BKE_object_boundbox_calc_from_evaluated_geometry(ob); | BKE_object_boundbox_calc_from_evaluated_geometry(ob); | ||||
| } | } | ||||
| void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) | void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) | ||||
| { | { | ||||
| bool doit = false; | bool doit = false; | ||||
| Show All 17 Lines | |||||
I'd call it input_curve (input as in input of the modifier stack), to not be confused with original curve which is owned by bmain.