36 #include "RNA_prototypes.h"
74 item_tmp.identifier = item_tmp.name =
"All Collections";
75 item_tmp.value = INT_MAX;
83 item_tmp.identifier = item_tmp.name = collection->
id.
name + 2;
101 const int collection_object_index)
106 if (i == collection_object_index) {
122 bmain,
scene, ob, single_collection_index);
123 bool is_cycle =
false;
124 bool updated =
false;
132 if (single_collection && collection != single_collection) {
176 ot->
name =
"Add Selected to Active Collection";
177 ot->
description =
"Add the object to an object collection that contains the active object";
178 ot->
idname =
"COLLECTION_OT_objects_add_active";
194 "The collection to add other selected objects to");
208 bmain,
scene, ob, single_collection_index);
218 if (single_collection && collection != single_collection) {
249 ot->
name =
"Remove Selected from Active Collection";
250 ot->
description =
"Remove the object from an object collection that contains the active object";
251 ot->
idname =
"COLLECTION_OT_objects_remove_active";
267 "The collection to remove other selected objects from");
292 ot->
name =
"Remove from All Collections";
293 ot->
description =
"Remove selected objects from all collections";
294 ot->
idname =
"COLLECTION_OT_objects_remove_all";
311 bmain,
scene, ob, single_collection_index);
312 bool updated =
false;
319 if (single_collection && collection != single_collection) {
351 ot->
name =
"Remove from Collection";
352 ot->
description =
"Remove selected objects from a collection";
353 ot->
idname =
"COLLECTION_OT_objects_remove";
369 "The collection to remove this object from");
400 ot->
name =
"Create New Collection";
401 ot->
description =
"Create an object collection from selected objects";
402 ot->
idname =
"COLLECTION_OT_create";
412 ot->
srna,
"name",
"Collection",
MAX_ID_NAME - 2,
"Name",
"Name of the new collection");
441 ot->
name =
"Add to Collection";
442 ot->
idname =
"OBJECT_OT_collection_add";
491 "Could not add the collection because of dependency cycle detected");
510 ot->
name =
"Link to Collection";
511 ot->
idname =
"OBJECT_OT_collection_link";
535 if (!ob || !collection) {
541 "Cannot remove an object from a linked or library override collection");
558 ot->
name =
"Remove Collection";
559 ot->
idname =
"OBJECT_OT_collection_remove";
560 ot->
description =
"Remove the active object from this collection";
582 "Cannot unlink a library override collection which is not the root of its override "
599 ot->
name =
"Unlink Collection";
600 ot->
idname =
"OBJECT_OT_collection_unlink";
639 ot->
name =
"Select Objects in Collection";
640 ot->
idname =
"OBJECT_OT_collection_objects_select";
struct Collection * BKE_collection_add(struct Main *bmain, struct Collection *parent, const char *name)
struct Collection * BKE_collection_object_find(struct Main *bmain, struct Scene *scene, struct Collection *collection, struct Object *ob)
#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance)
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
bool BKE_collection_object_cyclic_check(struct Main *bmain, struct Object *object, struct Collection *collection)
bool BKE_collection_has_object(struct Collection *collection, const struct Object *ob)
bool BKE_collection_has_object_recursive(struct Collection *collection, struct Object *ob)
bool BKE_collection_object_remove(struct Main *bmain, struct Collection *collection, struct Object *object, bool free_us)
#define FOREACH_COLLECTION_END
struct Scene * CTX_data_scene(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void id_fake_user_set(struct ID *id)
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
General operations, lookup, etc. for blender objects.
void BKE_object_groups_clear(struct Main *bmain, struct Scene *scene, struct Object *object)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define OBACT(_view_layer)
struct Object * ED_object_context(const struct bContext *C)
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
bool ED_operator_objectmode(struct bContext *C)
const EnumPropertyItem * RNA_collection_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
int UI_icon_color_from_collection(const struct Collection *collection)
static Collection * collection_object_active_find_index(Main *bmain, Scene *scene, Object *ob, const int collection_object_index)
void COLLECTION_OT_create(wmOperatorType *ot)
void COLLECTION_OT_objects_remove(wmOperatorType *ot)
static int collection_remove_exec(bContext *C, wmOperator *op)
void OBJECT_OT_collection_link(wmOperatorType *ot)
void COLLECTION_OT_objects_remove_all(wmOperatorType *ot)
void OBJECT_OT_collection_unlink(wmOperatorType *ot)
void OBJECT_OT_collection_objects_select(wmOperatorType *ot)
static int collection_unlink_exec(bContext *C, wmOperator *op)
static int objects_add_active_exec(bContext *C, wmOperator *op)
static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op))
void COLLECTION_OT_objects_remove_active(wmOperatorType *ot)
static const EnumPropertyItem * collection_object_active_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static int collection_objects_remove_exec(bContext *C, wmOperator *op)
static int collection_link_exec(bContext *C, wmOperator *op)
static int collection_objects_remove_all_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_collection_add(wmOperatorType *ot)
static int collection_add_exec(bContext *C, wmOperator *UNUSED(op))
static int collection_create_exec(bContext *C, wmOperator *op)
void OBJECT_OT_collection_remove(wmOperatorType *ot)
void COLLECTION_OT_objects_add_active(wmOperatorType *ot)
static int objects_remove_active_exec(bContext *C, wmOperator *op)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem DummyRNA_NULL_items[]
struct ID * hierarchy_root
IDOverrideLibrary * override_library
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))