[Bf-blender-cvs] [f8ead736a01] master: Fix FONT objects cannot use Object Font anymore

Philipp Oeser noreply at git.blender.org
Thu Sep 9 09:41:28 CEST 2021


Commit: f8ead736a017a013777bd9e20a76b461bd990dad
Author: Philipp Oeser
Date:   Thu Sep 9 09:16:03 2021 +0200
Branches: master
https://developer.blender.org/rBf8ead736a017a013777bd9e20a76b461bd990dad

Fix FONT objects cannot use Object Font anymore

Mistake in {rB459974896228}.

To use Object Fonts, (vertex) instancing needs to be enabled.
So bring back the instancing panel and improve the instancing choice
(similar to rB6c0c766bcaa0) by just giving the 'Vertex' choice (or
'None') and explain this is only used for Object Fonts on characters.

Was reported in D11348 itself.

Differential Revision: https://developer.blender.org/D12438

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

M	release/scripts/startup/bl_ui/properties_object.py
M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 52af4fafd09..81a641a20cf 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -267,7 +267,8 @@ class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
     @classmethod
     def poll(cls, context):
         ob = context.object
-        return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD'})
+        # FONT objects need (vertex) instancing for the 'Object Font' feature
+        return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD', 'FONT'})
 
     def draw(self, context):
         layout = self.layout
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index d3cd3158db1..99865078cbe 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -224,6 +224,12 @@ static EnumPropertyItem instance_items_empty[] = {
     INSTANCE_ITEM_COLLECTION,
     {0, NULL, 0, NULL, NULL},
 };
+
+static EnumPropertyItem instance_items_font[] = {
+    {0, "NONE", 0, "None", ""},
+    {OB_DUPLIVERTS, "VERTS", 0, "Vertices", "Use Object Font on characters"},
+    {0, NULL, 0, NULL, NULL},
+};
 #endif
 #undef INSTANCE_ITEMS_SHARED
 #undef INSTANCE_ITEM_COLLECTION
@@ -762,6 +768,9 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
   else if (ob->type == OB_POINTCLOUD) {
     item = instance_items_pointcloud;
   }
+  else if (ob->type == OB_FONT) {
+    item = instance_items_font;
+  }
   else {
     item = instance_items_nogroup;
   }



More information about the Bf-blender-cvs mailing list