Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_collection.c
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "UI_interface_icons.h" | |||||
| #include "object_intern.h" | #include "object_intern.h" | ||||
| /********************* 3d view operators ***********************/ | /********************* 3d view operators ***********************/ | ||||
| /* can be called with C == NULL */ | /* can be called with C == NULL */ | ||||
| static const EnumPropertyItem *collection_object_active_itemf(bContext *C, | static const EnumPropertyItem *collection_object_active_itemf(bContext *C, | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| Show All 28 Lines | if (count >= 2) { | ||||
| RNA_enum_item_add(&item, &totitem, &item_tmp); | RNA_enum_item_add(&item, &totitem, &item_tmp); | ||||
| RNA_enum_item_add_separator(&item, &totitem); | RNA_enum_item_add_separator(&item, &totitem); | ||||
| } | } | ||||
| /* add collections */ | /* add collections */ | ||||
| collection = NULL; | collection = NULL; | ||||
| while ((collection = BKE_collection_object_find(bmain, scene, collection, ob))) { | while ((collection = BKE_collection_object_find(bmain, scene, collection, ob))) { | ||||
| item_tmp.identifier = item_tmp.name = collection->id.name + 2; | item_tmp.identifier = item_tmp.name = collection->id.name + 2; | ||||
| /* item_tmp.icon = ICON_ARMATURE_DATA; */ | item_tmp.icon = UI_collection_color_icon_get(collection); | ||||
| item_tmp.value = i; | item_tmp.value = i; | ||||
| RNA_enum_item_add(&item, &totitem, &item_tmp); | RNA_enum_item_add(&item, &totitem, &item_tmp); | ||||
| i++; | i++; | ||||
| } | } | ||||
| } | } | ||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| ▲ Show 20 Lines • Show All 543 Lines • Show Last 20 Lines | |||||