diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-04 13:53:20 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-04 13:55:36 +0300 |
commit | 4880e2e75a860f4716e3122f5ae14f34f50a9452 (patch) | |
tree | 6ba2c82e0fb1684e0926ce56bd67a61fdbdac1d7 /source/blender/blenkernel/BKE_library.h | |
parent | 3248eef697dedc777a2748f8f63e9031dfe5b599 (diff) |
ID management: add higher level BKE_id_new... helpers.
Those should be used in priority when you need to create either a new
datablock in Main, or a new temp one. Lower level BKE_libblock_...
should only be used when you need a very specific, uncommon behavior.
Diffstat (limited to 'source/blender/blenkernel/BKE_library.h')
-rw-r--r-- | source/blender/blenkernel/BKE_library.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index c34571fdd7a..0cd5e032f68 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -52,9 +52,13 @@ struct PropertyRNA; size_t BKE_libblock_get_alloc_info(short type, const char **name); void *BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT; -void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); +void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT; void BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1); +void *BKE_id_new(struct Main *bmain, const short type, const char *name); +void *BKE_id_new_nomain(const short type, const char *name); + + /** * New ID creation/copying options. */ |