Merge branch 'blender-v2.83-release'

This commit is contained in:
Bastien Montagne 2020-04-22 11:37:36 +02:00
commit 21f811cb6d
4 changed files with 19 additions and 8 deletions

View File

@ -210,8 +210,9 @@ ViewLayer *BKE_view_layer_add(Scene *scene,
case VIEWLAYER_ADD_COPY: {
/* Allocate and copy view layer data */
view_layer_new = MEM_callocN(sizeof(ViewLayer), "View Layer");
BLI_addtail(&scene->view_layers, view_layer_new);
*view_layer_new = *view_layer_source;
BKE_view_layer_copy_data(scene, scene, view_layer_new, view_layer_source, 0);
BLI_addtail(&scene->view_layers, view_layer_new);
BLI_strncpy_utf8(view_layer_new->name, name, sizeof(view_layer_new->name));
break;
@ -467,6 +468,10 @@ void BKE_view_layer_copy_data(Scene *scene_dst,
LayerCollection *lc_scene_dst = view_layer_dst->layer_collections.first;
lc_scene_dst->collection = scene_dst->master_collection;
if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
id_us_plus((ID *)view_layer_dst->mat_override);
}
}
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *newname)

View File

@ -9712,10 +9712,10 @@ static bool read_libblock_undo_restore(
const int id_tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_UNDO_OLD_ID_REUSED;
read_libblock_undo_restore_identical(fd, main, id, id_old, id_tag);
/* Insert into library map for lookup by newly read datablocks (with pointer
* value bhead->old) or existing datablocks in memory (pointer value id_old). */
/* Insert into library map for lookup by newly read datablocks (with pointer value bhead->old).
* Note that existing datablocks in memory (which pointer value would be id_old) are not
* remapped anymore, so no need to store this info here. */
oldnewmap_insert(fd->libmap, bhead->old, id_old, bhead->code);
oldnewmap_insert(fd->libmap, id_old, id_old, bhead->code);
*r_id_old = id_old;
return true;
@ -9786,11 +9786,11 @@ static BHead *read_libblock(FileData *fd,
* direct_link_library() may remove it from there in case of duplicates. */
BLI_addtail(lb, id);
/* Insert into library map for lookup by newly read datablocks (with pointer
* value bhead->old) or existing datablocks in memory (pointer value id_old). */
/* Insert into library map for lookup by newly read datablocks (with pointer value bhead->old).
* Note that existing datablocks in memory (which pointer value would be id_old) are not remapped
* remapped anymore, so no need to store this info here. */
ID *id_target = id_old ? id_old : id;
oldnewmap_insert(fd->libmap, bhead->old, id_target, bhead->code);
oldnewmap_insert(fd->libmap, id_old, id_target, bhead->code);
if (r_id) {
*r_id = id_target;

View File

@ -2588,6 +2588,12 @@ static void write_lightcache(WriteData *wd, LightCache *cache)
static void write_scene(WriteData *wd, Scene *sce, const void *id_address)
{
if (wd->use_memfile) {
/* Clean up, important in undo case to reduce false detection of changed datablocks. */
/* XXX This UI data should not be stored in Scene at all... */
memset(&sce->cursor, 0, sizeof(sce->cursor));
}
/* write LibData */
writestruct_at_address(wd, ID_SCE, Scene, 1, id_address, sce);
write_iddata(wd, &sce->id);

View File

@ -1129,8 +1129,8 @@ void UI_icons_free(void)
#ifndef WITH_HEADLESS
free_icons_textures();
free_iconfile_list(&iconfilelist);
BKE_icons_free();
#endif
BKE_icons_free();
}
void UI_icons_free_drawinfo(void *drawinfo)