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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-23 21:52:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-23 21:52:20 +0400
commit4a04f7206914a49f5f95adc5eb786237f1a9f547 (patch)
tree78aed2fa481f972fac0965f814bebebe9d71ae65 /source/blender/blenkernel/intern/material.c
parentf1cea89d99f0c80bdccd2ba1359142b5ff14cdb9 (diff)
remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index ebd05ab9bf8..12d92d57e86 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -296,15 +294,16 @@ void make_local_material(Material *ma)
*/
if(ma->id.lib==NULL) return;
- if(ma->id.us==1) {
- ma->id.lib= NULL;
- ma->id.flag= LIB_LOCAL;
- new_id(&bmain->mat, (ID *)ma, NULL);
+ /* One local user; set flag and return. */
+ if(ma->id.us==1) {
+ id_clear_lib_data(&bmain->mat, (ID *)ma);
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) {
@@ -357,14 +356,13 @@ void make_local_material(Material *ma)
}
mb= mb->id.next;
}
-
- if(local && lib==0) {
- ma->id.lib= NULL;
- ma->id.flag= LIB_LOCAL;
- new_id(&bmain->mat, (ID *)ma, NULL);
+ /* Only local users. */
+ if(local && lib==0) {
+ id_clear_lib_data(&bmain->mat, (ID *)ma);
extern_local_material(ma);
}
+ /* Both user and local, so copy. */
else if(local && lib) {
man= copy_material(ma);