diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-08 13:50:04 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-08 13:50:04 +0300 |
commit | 1cf5ce5e251efdb66dd7066decbdf2e7023a16f3 (patch) | |
tree | 9cd52eaafa74189e00c2192a74397b3d44af7b87 /source/blender/blenkernel/intern/particle.c | |
parent | df5fe9718b18aa730662fb7b0fe43bd02b22d0bf (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/particle.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 8d091767709..329f11a57b9 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3858,7 +3858,7 @@ ParticleSettings *BKE_particlesettings_add(Main *bmain, const char *name) { ParticleSettings *part; - part = BKE_libblock_alloc(bmain, ID_PA, name, 0); + part = BKE_id_new(bmain, ID_PA, name); default_particle_settings(part); @@ -5009,7 +5009,8 @@ void psys_apply_hair_lattice(Depsgraph *depsgraph, Scene *scene, Object *ob, Par } /* Draw Engine */ -void (*BKE_particle_batch_cache_dirty_tag_cb)(ParticleSystem *psys, eMeshBatchDirtyMode mode) = NULL; +void (*BKE_particle_batch_cache_dirty_tag_cb)(ParticleSystem *psys, + eMeshBatchDirtyMode mode) = NULL; void (*BKE_particle_batch_cache_free_cb)(ParticleSystem *psys) = NULL; void BKE_particle_batch_cache_dirty_tag(ParticleSystem *psys, eMeshBatchDirtyMode mode) |