diff options
author | Hans Goudey <h.goudey@me.com> | 2021-09-11 21:54:40 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-09-11 21:54:40 +0300 |
commit | b9febb54a492ac6c93802fb0aa189d4c3fd99b0b (patch) | |
tree | a2f3b1d773d3a2424d7db0c8d9a0a0899da17747 /source/blender/draw/engines | |
parent | c946fdb2e5fc1eab139f70f01ea4e673435455bd (diff) |
Geometry Nodes: Support modifier on curve objects
With this commit, curve objects support the geometry nodes modifier.
Curves objects now evaluate to `CurveEval` unless there was a previous
implicit conversion (tessellating modifiers, mesh modifiers, or the
settings in the curve "Geometry" panel). In the new code, curves are
only considered to be the wire edges-- any generated surface is a mesh
instead, stored in the evaluated geometry set.
The consolidation of concepts mentioned above allows remove a lot of
code that had to do with maintaining the `DispList` type temporarily
for modifiers and rendering. Instead, render engines see a separate
object for the mesh from the mesh geometry component, and when the
curve object evaluates to a curve, the `CurveEval` is always used for
drawing wire edges.
However, currently the `DispList` type is still maintained and used as
an intermediate step in implicit mesh conversion. In the future, more
uses of it could be changed to use `CurveEval` and `Mesh` instead.
This is mostly not changed behavior, it is just a formalization of
existing logic after recent fixes for 2.8 versions last year and two
years ago. Also, in the future more functionality can be converted
to nodes, removing cases of implicit conversions. For more discussion
on that topic, see T89676.
The `use_fill_deform` option is removed. It has not worked properly
since 2.62, and the choice for filling a curve before or after
deformation will work much better and be clearer with a node system.
Applying the geometry nodes modifier to generate a curve is not
implemented with this commit, so applying the modifier won't work
at all. This is a separate technical challenge, and should be solved
in a separate step.
Differential Revision: https://developer.blender.org/D11597
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_edit_text.c | 13 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_wireframe.c | 10 |
2 files changed, 4 insertions, 19 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_edit_text.c b/source/blender/draw/engines/overlay/overlay_edit_text.c index fd68b319f02..5356700f156 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_text.c +++ b/source/blender/draw/engines/overlay/overlay_edit_text.c @@ -180,19 +180,12 @@ static void edit_text_cache_populate_boxes(OVERLAY_Data *vedata, Object *ob) void OVERLAY_edit_text_cache_populate(OVERLAY_Data *vedata, Object *ob) { OVERLAY_PrivateData *pd = vedata->stl->pd; - Curve *cu = ob->data; struct GPUBatch *geom; bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; - bool has_surface = (cu->flag & (CU_FRONT | CU_BACK)) || cu->ext1 != 0.0f || cu->ext2 != 0.0f; - if ((cu->flag & CU_FAST) || !has_surface) { - geom = DRW_cache_text_edge_wire_get(ob); - if (geom) { - DRW_shgroup_call(pd->edit_text_wire_grp[do_in_front], geom, ob); - } - } - else { - /* object mode draws */ + geom = DRW_cache_text_edge_wire_get(ob); + if (geom) { + DRW_shgroup_call(pd->edit_text_wire_grp[do_in_front], geom, ob); } edit_text_cache_populate_select(vedata, ob); diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index b8a61ecc403..fde376beeb2 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -218,18 +218,10 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, struct GPUBatch *geom = NULL; switch (ob->type) { case OB_CURVE: - if (!pd->wireframe_mode && !use_wire && ob->runtime.curve_cache && - BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) { - break; - } geom = DRW_cache_curve_edge_wire_get(ob); break; case OB_FONT: - if (!pd->wireframe_mode && !use_wire && ob->runtime.curve_cache && - BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) { - break; - } - geom = DRW_cache_text_loose_edges_get(ob); + geom = DRW_cache_text_edge_wire_get(ob); break; case OB_SURF: geom = DRW_cache_surf_edge_wire_get(ob); |