Fix [#20756] Texture painting on 3D tends to forget textures in the new texture menu.
authorMatt Ebb <matt@mke3.net>
Fri, 22 Jan 2010 04:21:46 +0000 (04:21 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 22 Jan 2010 04:21:46 +0000 (04:21 +0000)
Part of this fix (loading files with brushes/textures) will only apply for new files saved after this commit

source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/brush.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c

index 8e7e698..5d264be 100644 (file)
@@ -43,7 +43,7 @@ struct bContext;
 struct ReportList;
 
 #define BLENDER_VERSION                        250
-#define BLENDER_SUBVERSION             11
+#define BLENDER_SUBVERSION             12
 
 #define BLENDER_MINVERSION             250
 #define BLENDER_MINSUBVERSION  0
index 99cd697..e915784 100644 (file)
@@ -89,6 +89,8 @@ Brush *add_brush(const char *name)
        brush->flag |= BRUSH_SPACE;
 
        brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
+       
+       default_mtex(&brush->mtex);
 
        /* enable fake user by default */
        brush->id.flag |= LIB_FAKEUSER;
index c8bcc43..7ba17ce 100644 (file)
@@ -10373,9 +10373,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
-       /* put 2.50 compatibility code here until next subversion bump */
-
-       if (1) {
+       if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 12))
+       {
                Scene *sce;
                Object *ob;
                Brush *brush;
@@ -10475,6 +10474,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
                
        }
+       
+       
+       /* put 2.50 compatibility code here until next subversion bump */
+       if (1) {
+               ;
+       }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
index 8673d84..f8e1523 100644 (file)
@@ -2324,6 +2324,8 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
                        writestruct(wd, ID_BR, "Brush", 1, brush);
                        if (brush->id.properties) IDP_WriteProperty(brush->id.properties, wd);
                        
+                       writestruct(wd, DATA, "MTex", 1, &brush->mtex);
+                       
                        if(brush->curve)
                                write_curvemapping(wd, brush->curve);
                }