[Bf-blender-cvs] [4328b56980e] master: Fix T66031: Text Material Change broken.

Bastien Montagne noreply at git.blender.org
Wed Jul 31 15:38:19 CEST 2019


Commit: 4328b56980efd0f12cc846bf8a8b7988335d51e5
Author: Bastien Montagne
Date:   Wed Jul 31 15:36:36 2019 +0200
Branches: master
https://developer.blender.org/rB4328b56980efd0f12cc846bf8a8b7988335d51e5

Fix T66031: Text Material Change broken.

font_to_curve code was not handling properly the case where it has nop
object to check for mat indices validity. Check should just not happen
then, not reset mat indices of chars to default 0 value.

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

M	source/blender/blenkernel/intern/font.c

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

diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index a0216e9b413..78117a4f615 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -1408,7 +1408,9 @@ static bool vfont_to_curve(Object *ob,
         cha = towupper(cha);
       }
 
-      if (ob == NULL || info->mat_nr > (ob->totcol)) {
+      /* Only do that check in case we do have an object, otherwise all materials get erased every
+       * time that code is called without an object... */
+      if (ob != NULL && (info->mat_nr > (ob->totcol))) {
         // CLOG_ERROR(
         //     &LOG, "Illegal material index (%d) in text object, setting to 0", info->mat_nr);
         info->mat_nr = 0;



More information about the Bf-blender-cvs mailing list