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 <montagne29@wanadoo.fr>2017-08-10 12:14:36 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-08-10 12:14:36 +0300
commit8c4ccab5fecad4be8603d9b2bfe325b485ca7075 (patch)
tree6db69948178cb2667d348ebabb9598c9e8f6c162 /source/blender/blenkernel
parent464c045b31b54d284da59efa71530fb6092696d3 (diff)
parentcf7a2c93e3a897a3300bc7df527c8ba271da0424 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/library.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 4721955af43..76b8aa2d446 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1120,23 +1120,21 @@ void *BKE_libblock_alloc_notest(short type)
*/
void *BKE_libblock_alloc(Main *bmain, short type, const char *name, const int flag)
{
- ID *id = NULL;
-
BLI_assert((flag & LIB_ID_CREATE_NO_ALLOCATE) == 0);
-
- id = BKE_libblock_alloc_notest(type);
- if ((flag & LIB_ID_CREATE_NO_MAIN) != 0) {
- id->tag |= LIB_TAG_NO_MAIN;
- }
- if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0) {
- id->tag |= LIB_TAG_NO_USER_REFCOUNT;
- }
+ ID *id = BKE_libblock_alloc_notest(type);
if (id) {
+ if ((flag & LIB_ID_CREATE_NO_MAIN) != 0) {
+ id->tag |= LIB_TAG_NO_MAIN;
+ }
+ if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0) {
+ id->tag |= LIB_TAG_NO_USER_REFCOUNT;
+ }
+
id->icon_id = 0;
- *( (short *)id->name) = type;
- if ((flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0) {
+ *((short *)id->name) = type;
+ if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
id->us = 1;
}
if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) {
@@ -1153,6 +1151,9 @@ void *BKE_libblock_alloc(Main *bmain, short type, const char *name, const int fl
DEG_id_type_tag(bmain, type);
}
}
+ else {
+ BLI_strncpy(id->name + 2, name, sizeof(id->name) - 2);
+ }
}
return id;