Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_collections.c
| Show First 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | void OUTLINER_OT_collection_unlink(wmOperatorType *ot) | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| /**********************************************************************************/ | /**********************************************************************************/ | ||||
| /* Add new collection. */ | /* Add new collection. */ | ||||
| static int collection_new_exec(bContext *C, wmOperator *UNUSED(op)) | static int collection_new_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| SpaceOops *soops = CTX_wm_space_outliner(C); | |||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| SceneCollection *scene_collection = BKE_collection_add(&scene->id, NULL, COLLECTION_TYPE_NONE, NULL); | SceneCollection *scene_collection = BKE_collection_add(&scene->id, NULL, COLLECTION_TYPE_NONE, NULL); | ||||
| BKE_collection_link(view_layer, scene_collection); | BKE_collection_link(view_layer, scene_collection); | ||||
| soops->storeflag = SO_TREESTORE_CLEANUP; | |||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); | WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void OUTLINER_OT_collection_new(wmOperatorType *ot) | void OUTLINER_OT_collection_new(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines | |||||