From e673c9dc938844d158abe543457aca8016ef8bc1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 7 Aug 2017 20:48:22 +0200 Subject: Merge again... --- source/blender/blenkernel/intern/lightprobe.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/lightprobe.c') diff --git a/source/blender/blenkernel/intern/lightprobe.c b/source/blender/blenkernel/intern/lightprobe.c index a1fa266512b..5601fa5ad42 100644 --- a/source/blender/blenkernel/intern/lightprobe.c +++ b/source/blender/blenkernel/intern/lightprobe.c @@ -59,22 +59,32 @@ void *BKE_lightprobe_add(Main *bmain, const char *name) { LightProbe *probe; - probe = BKE_libblock_alloc(bmain, ID_LP, name); + probe = BKE_libblock_alloc(bmain, ID_LP, name, 0); BKE_lightprobe_init(probe); return probe; } -LightProbe *BKE_lightprobe_copy(Main *bmain, LightProbe *probe) +/** + * Only copy internal data of LightProbe 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_lightprobe_copy_data( + Main *UNUSED(bmain), LightProbe *UNUSED(probe_dst), const LightProbe *UNUSED(probe_src), const int UNUSED(flag)) { - LightProbe *probe_new; - - probe_new = BKE_libblock_copy(bmain, &probe->id); - - BKE_id_copy_ensure_local(bmain, &probe->id, &probe_new->id); + /* Nothing to do here. */ +} - return probe_new; +LightProbe *BKE_lightprobe_copy(Main *bmain, const LightProbe *probe) +{ + LightProbe *probe_copy; + BKE_id_copy_ex(bmain, &probe->id, (ID **)&probe_copy, 0, false); + return probe_copy; } void BKE_lightprobe_make_local(Main *bmain, LightProbe *probe, const bool lib_local) -- cgit v1.2.3