diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-12 22:46:13 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-12 22:46:13 +0300 |
commit | 97c2c39916202f8d3d8e1f651ab9dfa171953af2 (patch) | |
tree | 15829d2ccbb30d03832053ee3cbfa62fed8f2361 | |
parent | a311fa96aa428b611bc07c4d7f8a002dd3e6b462 (diff) |
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
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.cc | 11 |
1 files changed, 8 insertions, 3 deletions
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; } |