Fix #109491: Erratic behavior of materials for text objects #109746

Closed
Philipp Oeser wants to merge 4 commits from lichtwerk/blender:109491 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

4 Commits

Author SHA1 Message Date
Philipp Oeser d9452e03f4 use "own" SUBVERSION bump 2023-07-21 14:49:53 +02:00
Philipp Oeser d4fb925be3 Merge branch 'main' into 109491 2023-07-21 14:46:34 +02:00
Philipp Oeser c44968b5a6 Merge branch 'main' into 109491 2023-07-21 11:59:03 +02:00
Philipp Oeser af5988184f Fix #109491: Erratic behavior of materials for text objects
Symptoms for this were most likely observed when removing material slots
(or moving them up/down).

For text objects, the `CharInfo` `mat_nr` material index starts at 1
(not at zero like for meshes or nurbs).
Code was mostly considering this (but not in all places, so material
index handling (removing/moving) could still go wrong.
This patch (hopefully) fixes the remaining places where the 1-based index
should be used.

In addition to that, new text objects will have their `CharInfo`
`mat_nr` index 1-based, places where the index is cleared also set it to
1 (instead of zero) now. This also includes version code to correct a
zero index for old files (and sets it to 1 as well).
2023-07-05 15:30:03 +02:00