Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.cc
| Show First 20 Lines • Show All 2,211 Lines • ▼ Show 20 Lines | |||||
| Object *BKE_object_add_only_object(Main *bmain, int type, const char *name) | Object *BKE_object_add_only_object(Main *bmain, int type, const char *name) | ||||
| { | { | ||||
| if (!name) { | if (!name) { | ||||
| name = get_obdata_defname(type); | name = get_obdata_defname(type); | ||||
| } | } | ||||
| /* We cannot use #BKE_id_new here as we need some custom initialization code. */ | /* We cannot use #BKE_id_new here as we need some custom initialization code. */ | ||||
| Object *ob = (Object *)BKE_libblock_alloc(bmain, ID_OB, name, 0); | Object *ob = (Object *)BKE_libblock_alloc(bmain, ID_OB, name, bmain ? 0 : LIB_ID_CREATE_NO_MAIN); | ||||
| /* We increase object user count when linking to Collections. */ | /* We increase object user count when linking to Collections. */ | ||||
| id_us_min(&ob->id); | id_us_min(&ob->id); | ||||
| /* default object vars */ | /* default object vars */ | ||||
| object_init(ob, type); | object_init(ob, type); | ||||
| return ob; | return ob; | ||||
| ▲ Show 20 Lines • Show All 3,357 Lines • Show Last 20 Lines | |||||