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.
This commit is contained in:
Bastien Montagne 2019-07-31 15:36:36 +02:00
parent 8b1041d510
commit 4328b56980
Notes: blender-bot 2023-02-14 09:44:56 +01:00
Referenced by issue #66031, Text Material Change
1 changed files with 3 additions and 1 deletions

View File

@ -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;