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
This commit is contained in:
@@ -218,6 +218,12 @@ static EnumPropertyItem instance_items_pointcloud[] = {
|
|||||||
{OB_DUPLIVERTS, "POINTS", 0, "Points", "Instantiate child objects on all points"},
|
{OB_DUPLIVERTS, "POINTS", 0, "Points", "Instantiate child objects on all points"},
|
||||||
{0, NULL, 0, NULL, NULL},
|
{0, NULL, 0, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static EnumPropertyItem instance_items_empty[] = {
|
||||||
|
{0, "NONE", 0, "None", ""},
|
||||||
|
INSTANCE_ITEM_COLLECTION,
|
||||||
|
{0, NULL, 0, NULL, NULL},
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
#undef INSTANCE_ITEMS_SHARED
|
#undef INSTANCE_ITEMS_SHARED
|
||||||
#undef INSTANCE_ITEM_COLLECTION
|
#undef INSTANCE_ITEM_COLLECTION
|
||||||
@@ -751,7 +757,7 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
|
|||||||
const EnumPropertyItem *item;
|
const EnumPropertyItem *item;
|
||||||
|
|
||||||
if (ob->type == OB_EMPTY) {
|
if (ob->type == OB_EMPTY) {
|
||||||
item = instance_items;
|
item = instance_items_empty;
|
||||||
}
|
}
|
||||||
else if (ob->type == OB_POINTCLOUD) {
|
else if (ob->type == OB_POINTCLOUD) {
|
||||||
item = instance_items_pointcloud;
|
item = instance_items_pointcloud;
|
||||||
|
|||||||
Reference in New Issue
Block a user