[Bf-blender-cvs] [fbae4c5ba3f] blender-v2.83-release: Fix T74700: "Convert Text to Curve" disregards "Text on Curve"

Philipp Oeser noreply at git.blender.org
Mon Apr 27 18:15:13 CEST 2020


Commit: fbae4c5ba3f6836b6223888de2fe346865acde31
Author: Philipp Oeser
Date:   Mon Apr 27 17:35:35 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBfbae4c5ba3f6836b6223888de2fe346865acde31

Fix T74700: "Convert Text to Curve" disregards "Text on Curve"

There was an assert here as well since using the original object to read
from was having an empty runtime curve cache.

Now use BKE_vfont_to_curve_ex instead of BKE_vfont_to_curve, so we can
read from the evaluated object and write to the original curves in order
to have the modified data taken into account on next object evaluation.
(BKE_vfont_to_curve would read and write to/from the same object)

Final solution provided by @sergey in that report, thx!

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

M	source/blender/editors/object/object_add.c

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

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 9119d1cac86..9e0a6d51614 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2380,13 +2380,8 @@ static int convert_exec(bContext *C, wmOperator *op)
 
       cu = newob->data;
 
-      /* TODO(sergey): Ideally DAG will create nurbs list for a curve data
-       *               datablock, but for until we've got granular update
-       *               lets take care by selves.
-       */
-      /* XXX This may fail/crash, since BKE_vfont_to_curve()
-       * accesses evaluated data in some cases (bastien). */
-      BKE_vfont_to_curve(newob, FO_EDIT);
+      Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
+      BKE_vfont_to_curve_ex(ob_eval, ob_eval->data, FO_EDIT, &cu->nurb, NULL, NULL, NULL, NULL);
 
       newob->type = OB_CURVE;
       cu->type = OB_CURVE;



More information about the Bf-blender-cvs mailing list