Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/camera.c
| Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | void *BKE_camera_add(Main *bmain, const char *name) | ||||
| cam = BKE_libblock_alloc(bmain, ID_CA, name); | cam = BKE_libblock_alloc(bmain, ID_CA, name); | ||||
| BKE_camera_init(cam); | BKE_camera_init(cam); | ||||
| return cam; | return cam; | ||||
| } | } | ||||
| Camera *BKE_camera_copy(Main *bmain, const Camera *cam) | /** | ||||
| * Only copy internal data of Camera ID from source to already allocated/initialized destination. | |||||
| * You probably nerver want to use that directly, use id_copy or BKE_id_copy_ex for typical needs. | |||||
| * | |||||
| * WARNING! This function will not handle ID user count! | |||||
| * | |||||
| * \param flag Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more). | |||||
| */ | |||||
| void BKE_camera_copy_data(Main *UNUSED(bmain), Camera *UNUSED(cam_dst), const Camera *UNUSED(cam_src), const int UNUSED(flag)) | |||||
| { | { | ||||
| Camera *camn; | /* Nothing to do! */ | ||||
| } | |||||
| camn = BKE_libblock_copy(bmain, &cam->id); | |||||
| BKE_id_copy_ensure_local(bmain, &cam->id, &camn->id); | |||||
| return camn; | Camera *BKE_camera_copy(Main *bmain, const Camera *cam) | ||||
| { | |||||
| Camera *cam_copy; | |||||
| BKE_id_copy_ex(bmain, &cam->id, (ID **)&cam_copy, 0, false); | |||||
| return cam_copy; | |||||
| } | } | ||||
| void BKE_camera_make_local(Main *bmain, Camera *cam, const bool lib_local) | void BKE_camera_make_local(Main *bmain, Camera *cam, const bool lib_local) | ||||
| { | { | ||||
| BKE_id_make_local_generic(bmain, &cam->id, true, lib_local); | BKE_id_make_local_generic(bmain, &cam->id, true, lib_local); | ||||
| } | } | ||||
| /** Free (or release) any data used by this camera (does not free the camera itself). */ | /** Free (or release) any data used by this camera (does not free the camera itself). */ | ||||
| ▲ Show 20 Lines • Show All 842 Lines • Show Last 20 Lines | |||||