Cycles: svn merge -r41225:41232 ^/trunk/blender
[blender.git] / source / blender / blenkernel / intern / brush.c
index 4555832..b5cdbc5 100644 (file)
@@ -181,7 +181,6 @@ void free_brush(Brush *brush)
 static void extern_local_brush(Brush *brush)
 {
        id_lib_extern((ID *)brush->mtex.tex);
-       id_lib_extern((ID *)brush->clone.image);
 }
 
 void make_local_brush(Brush *brush)
@@ -199,9 +198,10 @@ void make_local_brush(Brush *brush)
        if(brush->id.lib==NULL) return;
 
        if(brush->clone.image) {
-               /* special case: ima always local immediately. Clone image should only
-                  have one user anyway. */
-               id_clear_lib_data(&bmain->brush, (ID *)brush->clone.image);
+               /* special case: ima always local immediately */
+               brush->clone.image->id.lib= NULL;
+               brush->clone.image->id.flag= LIB_LOCAL;
+               new_id(&bmain->brush, (ID *)brush->clone.image, NULL);
                extern_local_brush(brush);
        }
 
@@ -213,7 +213,9 @@ void make_local_brush(Brush *brush)
        }
 
        if(local && lib==0) {
-               id_clear_lib_data(&bmain->brush, (ID *)brush);
+               brush->id.lib= NULL;
+               brush->id.flag= LIB_LOCAL;
+               new_id(&bmain->brush, (ID *)brush, NULL);
                extern_local_brush(brush);
 
                /* enable fake user by default */