[Bf-blender-cvs] [71bc9d47601] blender-v3.0-release: Fix T94624: Object as font instances don't work

Hans Goudey noreply at git.blender.org
Mon Jan 17 13:25:34 CET 2022


Commit: 71bc9d47601a433ace7073478a2ffffb92acbcaf
Author: Hans Goudey
Date:   Wed Jan 12 13:46:13 2022 -0600
Branches: blender-v3.0-release
https://developer.blender.org/rB71bc9d47601a433ace7073478a2ffffb92acbcaf

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 442755be15d..b5a07ae6b08 100644
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@ -1640,6 +1640,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;
@@ -1653,9 +1661,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