[Bf-blender-cvs] [97c2c399162] master: Fix T94624: Object as font instances don't work

Hans Goudey noreply at git.blender.org
Wed Jan 12 20:51:20 CET 2022


Commit: 97c2c39916202f8d3d8e1f651ab9dfa171953af2
Author: Hans Goudey
Date:   Wed Jan 12 13:46:13 2022 -0600
Branches: master
https://developer.blender.org/rB97c2c39916202f8d3d8e1f651ab9dfa171953af2

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

===================================================================

M	source/blender/blenkernel/intern/object_dupli.cc

===================================================================

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;
     }



More information about the Bf-blender-cvs mailing list