Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_displist.h" | #include "BKE_displist.h" | ||||
| #include "BKE_effect.h" | #include "BKE_effect.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_group.h" | #include "BKE_group.h" | ||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_lamp.h" | #include "BKE_lamp.h" | ||||
| #include "BKE_layer.h" | |||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_library_query.h" | #include "BKE_library_query.h" | ||||
| #include "BKE_library_remap.h" | #include "BKE_library_remap.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| ▲ Show 20 Lines • Show All 566 Lines • ▼ Show 20 Lines | Object *BKE_object_add_only_object(Main *bmain, int type, const char *name) | ||||
| BKE_object_init(ob); | BKE_object_init(ob); | ||||
| return ob; | return ob; | ||||
| } | } | ||||
| /* general add: to scene, with layer from area and default name */ | /* general add: to scene, with layer from area and default name */ | ||||
| /* creates minimum required data, but without vertices etc. */ | /* creates minimum required data, but without vertices etc. */ | ||||
| Object *BKE_object_add( | Object *BKE_object_add( | ||||
| Main *bmain, Scene *scene, | Main *bmain, Scene *scene, SceneLayer *sl, | ||||
| int type, const char *name) | int type, const char *name) | ||||
| { | { | ||||
| Object *ob; | Object *ob; | ||||
| Base *base; | ObjectBase *base; | ||||
| LayerCollection *lc; | |||||
| ob = BKE_object_add_only_object(bmain, type, name); | ob = BKE_object_add_only_object(bmain, type, name); | ||||
| ob->data = BKE_object_obdata_add_from_type(bmain, type, name); | ob->data = BKE_object_obdata_add_from_type(bmain, type, name); | ||||
| ob->lay = scene->lay; | lc = BKE_layer_collection_active(sl); | ||||
| BKE_collection_object_add(scene, lc->scene_collection, ob); | |||||
| base = BKE_scene_base_add(scene, ob); | base = BKE_scene_layer_base_find(sl, ob); | ||||
| BKE_scene_base_deselect_all(scene); | BKE_scene_layer_base_deselect_all(sl); | ||||
| BKE_scene_base_select(scene, base); | BKE_scene_layer_base_select(sl, base); | ||||
| DAG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); | |||||
| DAG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); | |||||
| return ob; | return ob; | ||||
| } | } | ||||
| #ifdef WITH_GAMEENGINE | #ifdef WITH_GAMEENGINE | ||||
| void BKE_object_lod_add(Object *ob) | void BKE_object_lod_add(Object *ob) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 3,081 Lines • Show Last 20 Lines | |||||