147 &space_outliner->
tree,
169 return (space_outliner !=
NULL) &&
237 &space_outliner->
tree,
272 ot->
name =
"New Collection";
273 ot->
idname =
"OUTLINER_OT_collection_new";
274 ot->
description =
"Add a new collection inside selected collection";
285 ot->
srna,
"nested",
true,
"Nested",
"Add as child of selected collection");
343 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
386 "Cannot delete linked collection '%s', it is used by other linked scenes/collections",
410 if (basact_prev !=
BASACT(view_layer)) {
422 ot->
name =
"Delete Hierarchy";
423 ot->
idname =
"OUTLINER_OT_collection_hierarchy_delete";
451 switch (tselem->
type) {
469 .layer_collection =
NULL,
473 &space_outliner->
tree,
478 return data.layer_collection;
485 bool deselect =
STREQ(op->
idname,
"OUTLINER_OT_collection_objects_deselect");
504 ot->
name =
"Select Objects";
505 ot->
idname =
"OUTLINER_OT_collection_objects_select";
519 ot->
name =
"Deselect Objects";
520 ot->
idname =
"OUTLINER_OT_collection_objects_deselect";
547 switch (tselem->
type) {
568 &space_outliner->
tree,
580 const bool linked = strstr(op->
idname,
"linked") !=
NULL;
620 if (parent ==
NULL) {
623 "Could not find a valid parent collection for the new duplicate, "
624 "it won't be linked to any view layer");
640 ot->
name =
"Duplicate Linked Collection";
641 ot->
idname =
"OUTLINER_OT_collection_duplicate_linked";
643 "Recursively duplicate the collection, all its children and objects, with linked object "
657 ot->
name =
"Duplicate Collection";
658 ot->
idname =
"OUTLINER_OT_collection_duplicate";
660 "Recursively duplicate the collection, all its children, objects and object data";
691 op->
reports,
RPT_ERROR,
"Cannot add a collection to a linked/override collection/scene");
703 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
722 ot->
name =
"Link Collection";
723 ot->
idname =
"OUTLINER_OT_collection_link";
724 ot->
description =
"Link selected collections to active scene";
762 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
771 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
793 ot->
name =
"Instance Collection";
794 ot->
idname =
"OUTLINER_OT_collection_instance";
795 ot->
description =
"Instance selected collections to active scene";
859 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
915 int flag = strstr(op->
idname,
"holdout") ?
930 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
948 ot->
name =
"Disable from View Layer";
949 ot->
idname =
"OUTLINER_OT_collection_exclude_set";
950 ot->
description =
"Exclude collection from the active view layer";
963 ot->
name =
"Enable in View Layer";
964 ot->
idname =
"OUTLINER_OT_collection_exclude_clear";
965 ot->
description =
"Include collection in the active view layer";
979 ot->
idname =
"OUTLINER_OT_collection_holdout_set";
980 ot->
description =
"Mask collection in the active view layer";
993 ot->
name =
"Clear Holdout";
994 ot->
idname =
"OUTLINER_OT_collection_holdout_clear";
995 ot->
description =
"Clear masking of collection in the active view layer";
1008 ot->
name =
"Set Indirect Only";
1009 ot->
idname =
"OUTLINER_OT_collection_indirect_only_set";
1011 "Set collection to only contribute indirectly (through shadows and reflections) in the view "
1025 ot->
name =
"Clear Indirect Only";
1026 ot->
idname =
"OUTLINER_OT_collection_indirect_only_clear";
1027 ot->
description =
"Clear collection contributing only indirectly in the view layer";
1062 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
1078 scene, view_layer, layer_collection,
NULL, prop,
"hide_viewport", value);
1103 ot->
name =
"Isolate Collection";
1104 ot->
idname =
"OUTLINER_OT_collection_isolate";
1105 ot->
description =
"Hide all but this collection and its parents";
1117 ot->
srna,
"extend",
false,
"Extend",
"Extend current visible collections");
1145 const bool show = strstr(op->
idname,
"show") !=
NULL;
1160 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
1176 ot->
name =
"Show Collection";
1177 ot->
idname =
"OUTLINER_OT_collection_show";
1191 ot->
name =
"Hide Collection";
1192 ot->
idname =
"OUTLINER_OT_collection_hide";
1206 ot->
name =
"Show Inside Collection";
1207 ot->
idname =
"OUTLINER_OT_collection_show_inside";
1208 ot->
description =
"Show all the objects and collections inside the collection";
1221 ot->
name =
"Hide Inside Collection";
1222 ot->
idname =
"OUTLINER_OT_collection_hide_inside";
1223 ot->
description =
"Hide all the objects and collections inside the collection";
1251 if (collection ==
NULL) {
1255 if (
clear && (collection->
flag & flag)) {
1258 if (!
clear && !(collection->
flag & flag)) {
1290 const bool is_render = strstr(op->
idname,
"render");
1300 if (has_layer_collection) {
1308 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
1315 collection->
flag &= ~flag;
1318 collection->
flag |= flag;
1322 if (
clear && !is_render) {
1336 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
1343 collection->
flag &= ~flag;
1346 collection->
flag |= flag;
1366 ot->
name =
"Enable Collection";
1367 ot->
idname =
"OUTLINER_OT_collection_enable";
1368 ot->
description =
"Enable viewport display in the view layers";
1381 ot->
name =
"Disable Collection";
1382 ot->
idname =
"OUTLINER_OT_collection_disable";
1383 ot->
description =
"Disable viewport display in the view layers";
1396 ot->
name =
"Enable Collection in Render";
1397 ot->
idname =
"OUTLINER_OT_collection_enable_render";
1411 ot->
name =
"Disable Collection in Render";
1412 ot->
idname =
"OUTLINER_OT_collection_disable_render";
1442 if (tselem ==
NULL) {
1489 GSET_ITER (collections_to_edit_iter,
data.collections_to_edit) {
1551 ot->
idname =
"OUTLINER_OT_unhide_all";
1579 &space_outliner->
tree,
1597 collection->color_tag = color_tag;
1610 ot->
name =
"Set Color Tag";
1611 ot->
idname =
"OUTLINER_OT_collection_color_tag_set";
1612 ot->
description =
"Set a color tag for the selected collections";
struct Collection * BKE_collection_add(struct Main *bmain, struct Collection *parent, const char *name)
bool BKE_collection_cycle_find(struct Collection *new_ancestor, struct Collection *collection)
bool BKE_collection_child_add(struct Main *bmain, struct Collection *parent, struct Collection *child)
bool BKE_collection_delete(struct Main *bmain, struct Collection *collection, bool hierarchy)
struct Collection * BKE_collection_duplicate(struct Main *bmain, struct Collection *parent, struct Collection *collection, const uint duplicate_flags, const uint duplicate_options)
struct Scene * CTX_data_scene(const bContext *C)
struct SpaceOutliner * CTX_wm_space_outliner(const bContext *C)
struct LayerCollection * CTX_data_layer_collection(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
const struct IDTypeInfo * BKE_idtype_get_info_from_id(const struct ID *id)
void BKE_layer_collection_set_flag(struct LayerCollection *lc, const int flag, const bool value)
bool BKE_layer_collection_objects_select(struct ViewLayer *view_layer, struct LayerCollection *lc, bool deselect)
struct LayerCollection * BKE_layer_collection_get_active(struct ViewLayer *view_layer)
void BKE_layer_collection_isolate_global(struct Scene *scene, struct ViewLayer *view_layer, struct LayerCollection *lc, bool extend)
struct LayerCollection * BKE_layer_collection_activate_parent(struct ViewLayer *view_layer, struct LayerCollection *lc)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_layer_collection_sync(const struct Scene *scene, struct ViewLayer *view_layer)
void BKE_layer_collection_set_visible(struct ViewLayer *view_layer, struct LayerCollection *lc, const bool visible, const bool hierarchy)
void id_lib_extern(struct ID *id)
void id_us_plus(struct ID *id)
void id_fake_user_clear(struct ID *id)
@ LIB_ID_DUPLICATE_IS_ROOT_ID
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
GSet * BLI_gset_ptr_new(const char *info)
#define GSET_ITER(gs_iter_, gset_)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
bool BLI_gset_add(GSet *gs, void *key)
#define LISTBASE_FOREACH(type, var, list)
struct LinkData * BLI_genericNodeN(void *data)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) 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.
@ COLLECTION_RESTRICT_RENDER
@ COLLECTION_RESTRICT_VIEWPORT
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_HOLDOUT
Object is a sort of wrapper for general info.
@ TSE_VIEW_COLLECTION_BASE
@ TSE_SCENE_COLLECTION_BASE
#define BASACT(_view_layer)
struct Object * ED_object_add_type(struct bContext *C, const int type, const char *name, const float loc[3], const float rot[3], const bool enter_editmode, const unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
void ED_outliner_select_sync_from_object_tag(struct bContext *C)
StructRNA RNA_LayerCollection
static bool is_inside(int x, int y, int cols, int rows)
static void clear(Message *msg)
bool active
all scheduled work for the GPU.
static bool outliner_view_layer_collections_editor_poll(bContext *C)
static bool collections_indirect_only_clear_poll(bContext *C)
void OUTLINER_OT_collection_disable(wmOperatorType *ot)
static int collection_new_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_collection_show_inside(wmOperatorType *ot)
void OUTLINER_OT_collection_objects_deselect(wmOperatorType *ot)
static int collection_isolate_exec(bContext *C, wmOperator *op)
static bool collections_exclude_set_poll(bContext *C)
void OUTLINER_OT_collection_duplicate_linked(wmOperatorType *ot)
static bool collections_holdout_clear_poll(bContext *C)
Collection * outliner_collection_from_tree_element(const TreeElement *te)
static TreeTraversalAction collection_find_selected_to_add(TreeElement *te, void *customdata)
void OUTLINER_OT_unhide_all(wmOperatorType *ot)
void OUTLINER_OT_collection_instance(wmOperatorType *ot)
static bool collections_indirect_only_set_poll(bContext *C)
static bool collection_hide_poll(bContext *C)
static bool collection_enable_poll(bContext *C)
static bool collections_view_layer_poll(bContext *C, bool clear, int flag)
void OUTLINER_OT_collection_holdout_set(wmOperatorType *ot)
void outliner_collection_delete(bContext *C, Main *bmain, Scene *scene, ReportList *reports, bool hierarchy)
static TreeTraversalAction outliner_find_first_selected_collection(TreeElement *te, void *customdata)
void OUTLINER_OT_collection_exclude_set(wmOperatorType *ot)
static int collection_visibility_exec(bContext *C, wmOperator *op)
void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects)
static int collection_flag_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_collection_objects_select(wmOperatorType *ot)
static bool collections_exclude_clear_poll(bContext *C)
TreeTraversalAction outliner_find_selected_collections(TreeElement *te, void *customdata)
void OUTLINER_OT_collection_new(wmOperatorType *ot)
bool ED_outliner_collections_editor_poll(bContext *C)
static int collection_isolate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static TreeTraversalAction outliner_find_first_selected_layer_collection(TreeElement *te, void *customdata)
void OUTLINER_OT_collection_duplicate(wmOperatorType *ot)
TreeTraversalAction outliner_find_selected_objects(TreeElement *te, void *customdata)
void OUTLINER_OT_collection_hide_inside(wmOperatorType *ot)
static bool collection_show_poll(bContext *C)
void OUTLINER_OT_collection_holdout_clear(wmOperatorType *ot)
void OUTLINER_OT_collection_indirect_only_clear(wmOperatorType *ot)
void OUTLINER_OT_collection_disable_render(wmOperatorType *ot)
static TreeTraversalAction layer_collection_find_data_to_edit(TreeElement *te, void *customdata)
void OUTLINER_OT_collection_hide(wmOperatorType *ot)
static TreeTraversalAction collection_find_data_to_edit(TreeElement *te, void *customdata)
static bool collection_disable_poll(bContext *C)
static TreeElement * outliner_active_collection(bContext *C)
static int outliner_hide_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_collection_exclude_clear(wmOperatorType *ot)
static int collection_objects_select_exec(bContext *C, wmOperator *op)
static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op)
static bool collections_holdout_set_poll(bContext *C)
static int collection_link_exec(bContext *C, wmOperator *op)
bool outliner_is_collection_tree_element(const TreeElement *te)
static int collection_instance_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_collection_enable_render(wmOperatorType *ot)
static bool collection_enable_render_poll(bContext *C)
static LayerCollection * outliner_active_layer_collection(bContext *C)
void OUTLINER_OT_collection_enable(wmOperatorType *ot)
static int outliner_unhide_all_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_collection_indirect_only_set(wmOperatorType *ot)
static TreeTraversalAction outliner_hide_find_data_to_edit(TreeElement *te, void *customdata)
static bool collection_edit_in_active_scene_poll(bContext *C)
void OUTLINER_OT_hide(wmOperatorType *ot)
static int collection_duplicate_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_collection_color_tag_set(wmOperatorType *ot)
static bool collection_inside_poll(bContext *C)
static bool collection_disable_render_poll(bContext *C)
void OUTLINER_OT_collection_hierarchy_delete(wmOperatorType *ot)
static int collection_view_layer_exec(bContext *C, wmOperator *op)
static bool collection_flag_poll(bContext *C, bool clear, int flag)
void OUTLINER_OT_collection_isolate(wmOperatorType *ot)
void OUTLINER_OT_collection_show(wmOperatorType *ot)
static int outliner_color_tag_set_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_collection_link(wmOperatorType *ot)
void outliner_collection_isolate_flag(Scene *scene, ViewLayer *view_layer, LayerCollection *layer_collection, Collection *collection, PropertyRNA *layer_or_collection_prop, const char *propname, const bool value)
bool outliner_tree_traverse(const SpaceOutliner *space_outliner, ListBase *tree, int filter_te_flag, int filter_tselem_flag, TreeTraversalFunc func, void *customdata)
void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct ViewLayer *view_layer, struct SpaceOutliner *space_outliner, struct ARegion *region)
void outliner_cleanup_tree(struct SpaceOutliner *space_outliner)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_collection_color_items[]
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
SpaceOutliner * space_outliner
GSet * collections_to_edit
LayerCollection * layer_collection
IDTypeEmbeddedOwnerGetFunction owner_get
struct ListBase selected_array
ListBase layer_collections
struct Collection * collection
struct Collection * instance_collection
SpaceOutliner * space_outliner
GSet * collections_to_edit
struct Collection * master_collection
struct TreeElement * parent
ListBase layer_collections
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)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)