diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-02-03 20:37:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-03 20:37:23 +0300 |
commit | 0936f2f52c584ba623ba6ec722d1581dea97f1f3 (patch) | |
tree | 4287a457151a14f389836e2904754ce65165d93b /source/blender/blenkernel/intern/object_dupli.c | |
parent | 3d6e7cd67c2dac8acbce585efed2fa34341f2676 (diff) |
Fix T73045 Crash entering edit mode for "Object Font" instance mesh
Font duplicator was not outputing dupli-objects using evaluated object
pointers, leading to crash because original object are not supposed to
be drawable.
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.c')
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index eceeb231285..c10ab3cddab 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -521,6 +521,9 @@ static void make_duplis_font(const DupliContext *ctx) family_len = strlen(cu->family); family_gh = BLI_ghash_int_new_ex(__func__, 256); + /* Safety check even if it might fail badly when called for original object. */ + const bool is_eval_curve = DEG_is_evaluated_id(&cu->id); + /* advance matching BLI_strncpy_wchar_from_utf8 */ for (a = 0; a < text_len; a++, ct++) { @@ -528,6 +531,12 @@ static void make_duplis_font(const DupliContext *ctx) * Definitively don't think it would be safe to put back Main *bmain pointer * in DupliContext as done in 2.7x? */ ob = find_family_object(G.main, cu->family, family_len, (unsigned int)text[a], family_gh); + + if (is_eval_curve) { + /* Workaround for the above hack. */ + ob = DEG_get_evaluated_object(ctx->depsgraph, ob); + } + if (ob) { vec[0] = fsize * (ct->xof - xof); vec[1] = fsize * (ct->yof - yof); |