Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/movieclip.c
| Show First 20 Lines • Show All 1,482 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| /* Also frees animdata. */ | /* Also frees animdata. */ | ||||
| free_buffers(clip); | free_buffers(clip); | ||||
| BKE_tracking_free(&clip->tracking); | BKE_tracking_free(&clip->tracking); | ||||
| BKE_animdata_free((ID *) clip, false); | BKE_animdata_free((ID *) clip, false); | ||||
| } | } | ||||
| MovieClip *BKE_movieclip_copy(Main *bmain, const MovieClip *clip) | /** | ||||
| * Only copy internal data of MovieClip 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_movieclip_copy_data(Main *UNUSED(bmain), MovieClip *clip_dst, const MovieClip *clip_src, const int flag) | |||||
| { | { | ||||
| MovieClip *clip_new; | /* We never handle usercount here for own data. */ | ||||
| const int flag_subdata = flag | LIB_ID_COPY_NO_USER_REFCOUNT; | |||||
| clip_new = BKE_libblock_copy(bmain, &clip->id); | |||||
| clip_new->anim = NULL; | clip_dst->anim = NULL; | ||||
| clip_new->cache = NULL; | clip_dst->cache = NULL; | ||||
| BKE_tracking_copy(&clip_new->tracking, &clip->tracking); | BKE_tracking_copy(&clip_dst->tracking, &clip_src->tracking, flag_subdata); | ||||
| clip_new->tracking_context = NULL; | clip_dst->tracking_context = NULL; | ||||
| id_us_plus((ID *)clip_new->gpd); | BKE_color_managed_colorspace_settings_copy(&clip_dst->colorspace_settings, &clip_src->colorspace_settings); | ||||
| } | |||||
| BKE_color_managed_colorspace_settings_copy(&clip_new->colorspace_settings, &clip->colorspace_settings); | |||||
| BKE_id_copy_ensure_local(bmain, &clip->id, &clip_new->id); | |||||
| return clip_new; | MovieClip *BKE_movieclip_copy(Main *bmain, const MovieClip *clip) | ||||
| { | |||||
| MovieClip *clip_copy; | |||||
| BKE_id_copy_ex(bmain, &clip->id, (ID **)&clip_copy, 0, false); | |||||
| return clip_copy; | |||||
| } | } | ||||
| void BKE_movieclip_make_local(Main *bmain, MovieClip *clip, const bool lib_local) | void BKE_movieclip_make_local(Main *bmain, MovieClip *clip, const bool lib_local) | ||||
| { | { | ||||
| BKE_id_make_local_generic(bmain, &clip->id, true, lib_local); | BKE_id_make_local_generic(bmain, &clip->id, true, lib_local); | ||||
| } | } | ||||
| float BKE_movieclip_remap_scene_to_clip_frame(MovieClip *clip, float framenr) | float BKE_movieclip_remap_scene_to_clip_frame(MovieClip *clip, float framenr) | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||