[Bf-blender-cvs] [6c0c766bcaa] master: UI: hide instancing options for empties which cannot be used

Philipp Oeser noreply at git.blender.org
Tue Aug 10 16:10:39 CEST 2021


Commit: 6c0c766bcaa013007e12f2fd3e308d83cd95594c
Author: Philipp Oeser
Date:   Fri May 21 18:25:35 2021 +0200
Branches: master
https://developer.blender.org/rB6c0c766bcaa013007e12f2fd3e308d83cd95594c

UI: hide instancing options for empties which cannot be used

Empties can only instance a collection, instancing on "Vertices" or
"Faces" does not make sense for empties, make that clear in the UI.

ref D11348

Maniphest Tasks: T88443

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

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

M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index bef430b0314..0f6b89722a4 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -218,6 +218,12 @@ static EnumPropertyItem instance_items_pointcloud[] = {
     {OB_DUPLIVERTS, "POINTS", 0, "Points", "Instantiate child objects on all points"},
     {0, NULL, 0, NULL, NULL},
 };
+
+static EnumPropertyItem instance_items_empty[] = {
+    {0, "NONE", 0, "None", ""},
+    INSTANCE_ITEM_COLLECTION,
+    {0, NULL, 0, NULL, NULL},
+};
 #endif
 #undef INSTANCE_ITEMS_SHARED
 #undef INSTANCE_ITEM_COLLECTION
@@ -751,7 +757,7 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
   const EnumPropertyItem *item;
 
   if (ob->type == OB_EMPTY) {
-    item = instance_items;
+    item = instance_items_empty;
   }
   else if (ob->type == OB_POINTCLOUD) {
     item = instance_items_pointcloud;



More information about the Bf-blender-cvs mailing list