Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-07-31 16:36:36 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-07-31 16:38:01 +0300
commit4328b56980efd0f12cc846bf8a8b7988335d51e5 (patch)
treec2e5bbf4be3e1608547dde1b10ab320f7991506e /source/blender/blenkernel/intern/font.c
parent8b1041d510dd18fe7d4f4c60856e66e0f4dedff0 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/font.c')
-rw-r--r--source/blender/blenkernel/intern/font.c4
1 files changed, 3 insertions, 1 deletions
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;