Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/collection.c
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | if (name_custom) { | ||||
| STRNCPY(name, name_custom); | STRNCPY(name, name_custom); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_collection_new_name_get(collection_parent, name); | BKE_collection_new_name_get(collection_parent, name); | ||||
| } | } | ||||
| /* Create new collection. */ | /* Create new collection. */ | ||||
| Collection *collection = BKE_libblock_alloc(bmain, ID_GR, name, 0); | Collection *collection = BKE_libblock_alloc(bmain, ID_GR, name, 0); | ||||
| collection->color_tag = COLLECTION_COLOR_NONE; | |||||
| /* We increase collection user count when linking to Collections. */ | /* We increase collection user count when linking to Collections. */ | ||||
| id_us_min(&collection->id); | id_us_min(&collection->id); | ||||
| /* Optionally add to parent collection. */ | /* Optionally add to parent collection. */ | ||||
| if (collection_parent) { | if (collection_parent) { | ||||
| collection_child_add(collection_parent, collection, 0, true); | collection_child_add(collection_parent, collection, 0, true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,603 Lines • Show Last 20 Lines | |||||