Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-10-08 13:50:04 +0300
committerBastien Montagne <bastien@blender.org>2020-10-08 13:50:04 +0300
commit1cf5ce5e251efdb66dd7066decbdf2e7023a16f3 (patch)
tree9cd52eaafa74189e00c2192a74397b3d44af7b87 /source/blender/blenkernel/intern/volume.cc
parentdf5fe9718b18aa730662fb7b0fe43bd02b22d0bf (diff)
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_<id_type>_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'.
Diffstat (limited to 'source/blender/blenkernel/intern/volume.cc')
-rw-r--r--source/blender/blenkernel/intern/volume.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 382787fd0f9..e52352499cd 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -603,9 +603,7 @@ void BKE_volume_init_grids(Volume *volume)
void *BKE_volume_add(Main *bmain, const char *name)
{
- Volume *volume = (Volume *)BKE_libblock_alloc(bmain, ID_VO, name, 0);
-
- volume_init_data(&volume->id);
+ Volume *volume = (Volume *)BKE_id_new(bmain, ID_VO, name);
return volume;
}