From 1cf5ce5e251efdb66dd7066decbdf2e7023a16f3 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 8 Oct 2020 12:50:04 +0200 Subject: Cleanup/refactor: `BKE_libblock_alloc` -> `BKE_id_new` in ID creation code. Better use higher-level code from common ID management when possible. Helps to de-duplicate logic, and reduces outside usages of more 'dangerous' functions. Note that we could get rid of many of those `BKE__add` functions now, but on the other hand several of those take extra parameters and perform additional actions, so think we can keep them all for now as 'non-standard ID specific creation functions'. --- source/blender/blenkernel/intern/mball.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/mball.c') diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 84f07b7bc60..75d6d36159e 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -210,9 +210,7 @@ MetaBall *BKE_mball_add(Main *bmain, const char *name) { MetaBall *mb; - mb = BKE_libblock_alloc(bmain, ID_MB, name, 0); - - metaball_init_data(&mb->id); + mb = BKE_id_new(bmain, ID_MB, name); return mb; } -- cgit v1.2.3