diff options
author | Hans Goudey <h.goudey@me.com> | 2021-09-23 19:41:46 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-09-23 19:41:46 +0300 |
commit | eb0eb54d9644c5139ef139fee1e14da35c4fab7e (patch) | |
tree | 16eaeda657498caa9e5413796d7c01b6241857aa /source/blender/blenkernel/intern/displist.cc | |
parent | ed541de29dd01339736e04d95302e6e20495de54 (diff) |
Fix D12533: Simplify curve object to mesh conversion
This patch simplifies the curve object to mesh conversion
used by the object convert operator and exporters.
The existing code had a convoluted model of ownership, and did quite
a bit of unnecessary work. It also assumed that curve objects always
evaluated to a mesh, which is not the case anymore.
Now the code checks if the object it receives is evaluated. If so,
it can simply return a copy of the evaluated mesh (or convert the
evaluated curve wire edges to a mesh if there was no evaluated mesh).
If the object isn't evaluated, it uses a temporary copy of the object
with modifiers removed to create the mesh in the same way.
This follows up on the recent changes to curve evaluation,
namely that the result is always either a mesh or a wire curve.
Differential Revision: https://developer.blender.org/D12533
Diffstat (limited to 'source/blender/blenkernel/intern/displist.cc')
-rw-r--r-- | source/blender/blenkernel/intern/displist.cc | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index e756daa1156..79e913d266f 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -1540,23 +1540,6 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph, boundbox_displist_object(ob); } -void BKE_displist_make_curveTypes_forRender( - Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *r_dispbase, Mesh **r_final) -{ - if (ob->runtime.curve_cache == nullptr) { - ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache), __func__); - } - - if (ob->type == OB_SURF) { - evaluate_surface_object(depsgraph, scene, ob, true, r_dispbase, r_final); - } - else { - GeometrySet geometry_set = evaluate_curve_type_object(depsgraph, scene, ob, true, r_dispbase); - MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); - *r_final = mesh_component.release(); - } -} - void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) { bool doit = false; |