[Bf-blender-cvs] [0936f2f52c5] blender-v2.82-release: Fix T73045 Crash entering edit mode for "Object Font" instance mesh
Clément Foucault
noreply at git.blender.org
Mon Feb 3 18:38:38 CET 2020
Commit: 0936f2f52c584ba623ba6ec722d1581dea97f1f3
Author: Clément Foucault
Date: Mon Feb 3 18:37:12 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB0936f2f52c584ba623ba6ec722d1581dea97f1f3
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.
===================================================================
M source/blender/blenkernel/intern/object_dupli.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list