diff options
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 12d92d57e86..190df040bf4 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -294,16 +294,15 @@ void make_local_material(Material *ma) */ if(ma->id.lib==NULL) return; - - /* One local user; set flag and return. */ if(ma->id.us==1) { - id_clear_lib_data(&bmain->mat, (ID *)ma); + ma->id.lib= NULL; + ma->id.flag= LIB_LOCAL; + + new_id(&bmain->mat, (ID *)ma, NULL); extern_local_material(ma); return; } - - /* Check which other IDs reference this one to determine if it's used by - lib or local */ + /* test objects */ ob= bmain->object.first; while(ob) { @@ -356,13 +355,14 @@ void make_local_material(Material *ma) } mb= mb->id.next; } - - /* Only local users. */ + if(local && lib==0) { - id_clear_lib_data(&bmain->mat, (ID *)ma); + ma->id.lib= NULL; + ma->id.flag= LIB_LOCAL; + + new_id(&bmain->mat, (ID *)ma, NULL); extern_local_material(ma); } - /* Both user and local, so copy. */ else if(local && lib) { man= copy_material(ma); |