[Bf-blender-cvs] [32d5cd8b525] curve-nodes-modifier: Fix text object edit mode overlays

Hans Goudey noreply at git.blender.org
Tue Jul 13 01:40:49 CEST 2021


Commit: 32d5cd8b52539332202d9f39fa538e698273f43e
Author: Hans Goudey
Date:   Tue Jul 6 17:35:10 2021 -0500
Branches: curve-nodes-modifier
https://developer.blender.org/rB32d5cd8b52539332202d9f39fa538e698273f43e

Fix text object edit mode overlays

===================================================================

M	source/blender/blenkernel/intern/displist.cc
M	source/blender/depsgraph/intern/depsgraph_query_iter.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index 0df00e4c362..514d7212ea0 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -1546,8 +1546,8 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
 
     /* If the curve is in edit mode, make sure the output geometry set containts a
      * curve component, which is used indirectly to render the edit mode overlays. */
-    if (BKE_curve_editNurbs_get_for_read((const Curve *)ob->data) &&
-        !geometry_set.has<CurveComponent>()) {
+    const Curve *curve_orig = (const Curve *)ob->data;
+    if (BKE_curve_editNurbs_get_for_read(curve_orig) || curve_orig->editfont) {
       geometry_set.get_component_for_write<CurveComponent>();
     }
 
diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
index 2d4e5286e35..580f1cdff87 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
@@ -227,7 +227,7 @@ bool deg_iterator_components_step(BLI_Iterator *iter)
     if (component != nullptr) {
 
       /* Don't use a temporary object for this component when the owner is a curve object. */
-      if (data->geometry_component_owner->type == OB_CURVE) {
+      if (ELEM(data->geometry_component_owner->type, OB_CURVE, OB_FONT)) {
         iter->current = data->geometry_component_owner;
         return true;
       }
@@ -236,7 +236,10 @@ bool deg_iterator_components_step(BLI_Iterator *iter)
       if (curve != nullptr) {
         Object *temp_object = &data->temp_geometry_component_object;
         *temp_object = *data->geometry_component_owner;
-        temp_object->type = OB_CURVE;
+        /* Use OB_FONT when the owner is a text object, so that the text editing edit mode
+         * overlays will draw. Here it's important that text objects don't support the nodes
+         * modifier, so they always have data corresponding to their original text. */
+        temp_object->type = data->geometry_component_owner->type == OB_FONT ? OB_FONT : OB_CURVE;
         temp_object->data = (void *)curve;
         temp_object->runtime.select_id = data->geometry_component_owner->runtime.select_id;
         iter->current = temp_object;



More information about the Bf-blender-cvs mailing list