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>2015-01-09 11:52:51 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-09 11:53:58 +0300
commit95847f6ac7ce074501d0f7f2b874ef4036601dc4 (patch)
tree3bbf615280a30c7fa6ceebc5d3e222b0be93810e /source/blender/blenkernel/intern/material.c
parent1b8240f5af34310017b9f245021e31e6b02ae3ce (diff)
Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Propper fix reverting most of rB60e70c0c6014e5, which was only partial specific fix. This code uses generic `BKE_id_lib_local_paths()` func to handle all possible paths. Reviewers: sergey, campbellbarton Differential Revision: https://developer.blender.org/D977
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 83800a3fb2f..981064bb22a 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -252,6 +252,10 @@ Material *BKE_material_copy(Material *ma)
BLI_listbase_clear(&man->gpumaterial);
+ if (ma->id.lib) {
+ BKE_id_lib_local_paths(G.main, ma->id.lib, &man->id);
+ }
+
return man;
}