diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/lamp.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/world.c | 6 |
5 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 903b032e080..1f381a1a2c2 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -172,6 +172,9 @@ void BKE_lamp_make_local(Lamp *la) if (la->id.lib == NULL) return; if (la->id.us == 1) { id_clear_lib_data(bmain, &la->id); + /* nodetree uses same lib */ + if (la->nodetree) + la->nodetree->id.lib = NULL; return; } @@ -186,6 +189,9 @@ void BKE_lamp_make_local(Lamp *la) if (is_local && is_lib == FALSE) { id_clear_lib_data(bmain, &la->id); + /* nodetree uses same lib */ + if (la->nodetree) + la->nodetree->id.lib = NULL; } else if (is_local && is_lib) { Lamp *la_new = BKE_lamp_copy(la); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index c8cd65e9477..87fb64c0761 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -308,6 +308,9 @@ void BKE_material_make_local(Material *ma) if (ma->id.us == 1) { id_clear_lib_data(bmain, &ma->id); extern_local_material(ma); + /* nodetree uses same lib */ + if (ma->nodetree) + ma->nodetree->id.lib = NULL; return; } @@ -370,6 +373,9 @@ void BKE_material_make_local(Material *ma) if (is_local && is_lib == FALSE) { id_clear_lib_data(bmain, &ma->id); extern_local_material(ma); + /* nodetree uses same lib */ + if (ma->nodetree) + ma->nodetree->id.lib = NULL; } /* Both user and local, so copy. */ else if (is_local && is_lib) { diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 4f3bf4d1c0c..f9128eae866 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1124,6 +1124,7 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_id_use } else { newtree = MEM_dupallocN(ntree); + ntree->id.lib = NULL; /* same as owning datablock id.lib */ BKE_libblock_copy_data(&newtree->id, &ntree->id, true); /* copy animdata and ID props */ } diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 1d0b0deae7e..be48c7cf12a 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -765,6 +765,9 @@ void BKE_texture_make_local(Tex *tex) if (tex->id.us == 1) { id_clear_lib_data(bmain, &tex->id); extern_local_texture(tex); + /* nodetree uses same lib */ + if (tex->nodetree) + tex->nodetree->id.lib = NULL; return; } @@ -824,6 +827,9 @@ void BKE_texture_make_local(Tex *tex) if (is_local && is_lib == FALSE) { id_clear_lib_data(bmain, &tex->id); extern_local_texture(tex); + /* nodetree uses same lib */ + if (tex->nodetree) + tex->nodetree->id.lib = NULL; } else if (is_local && is_lib) { Tex *tex_new = BKE_texture_copy(tex); diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 206f829eaa8..050fcd2600b 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -179,6 +179,9 @@ void BKE_world_make_local(World *wrld) if (wrld->id.lib == NULL) return; if (wrld->id.us == 1) { id_clear_lib_data(bmain, &wrld->id); + /* nodetree uses same lib */ + if (wrld->nodetree) + wrld->nodetree->id.lib = NULL; return; } @@ -191,6 +194,9 @@ void BKE_world_make_local(World *wrld) if (is_local && is_lib == FALSE) { id_clear_lib_data(bmain, &wrld->id); + /* nodetree uses same lib */ + if (wrld->nodetree) + wrld->nodetree->id.lib = NULL; } else if (is_local && is_lib) { World *wrld_new = BKE_world_copy(wrld); |