From 97c2c39916202f8d3d8e1f651ab9dfa171953af2 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 12 Jan 2022 13:46:13 -0600 Subject: Fix T94624: Object as font instances don't work The fundamental limitation is that we can only have one instance ("dupli") generator at a time. Because the mesh output of a curve object is output as an instances, the geometry set instances existed, replacing the object as font instances. The "fix" is to reverse the order. The behavior won't be perfect still, but at least the old behavior will be preserved, which is really what matters for a feature like this. One way to take this change further would be completely disabling regular geometry evaluation while this option is active. However, it doesn't seem like that would actually improve the state of the code. Differential Revision: https://developer.blender.org/D13768 --- source/blender/blenkernel/intern/object_dupli.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 20fdda8bdc7..05b20a6879c 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -1650,6 +1650,14 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx) return nullptr; } + /* Give "Object as Font" instances higher priority than geometry set instances, to retain + * the behavior from before curve object meshes were processed as instances internally. */ + if (transflag & OB_DUPLIVERTS) { + if (ctx->object->type == OB_FONT) { + return &gen_dupli_verts_font; + } + } + if (ctx->object->runtime.geometry_set_eval != nullptr) { if (BKE_object_has_geometry_set_instances(ctx->object)) { return &gen_dupli_geometry_set; @@ -1663,9 +1671,6 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx) if (ctx->object->type == OB_MESH) { return &gen_dupli_verts; } - if (ctx->object->type == OB_FONT) { - return &gen_dupli_verts_font; - } if (ctx->object->type == OB_POINTCLOUD) { return &gen_dupli_verts_pointcloud; } -- cgit v1.2.3