Added some code in sculpt and RNA for textures with type none. Hopefully fixes the...
authorNicholas Bishop <nicholasbishop@gmail.com>
Mon, 26 Jan 2009 21:32:22 +0000 (21:32 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Mon, 26 Jan 2009 21:32:22 +0000 (21:32 +0000)
source/blender/editors/sculpt/sculpt.c
source/blender/makesrna/intern/rna_texture.c

index d617fde065a90f7aef2d90dc3b508c5398850193..c82d980726a2f79f826a0ddc97d14b26fa3ffa4c 100644 (file)
@@ -1655,11 +1655,14 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
                ts->sculpt->brush = add_brush("test brush");
                /* Also for testing, set the brush texture to the first available one */
                if(G.main->tex.first) {
-                       mtex = MEM_callocN(sizeof(MTex), "test mtex");
-                       ts->sculpt->brush->texact = 0;
-                       ts->sculpt->brush->mtex[0] = mtex;
-                       mtex->tex = G.main->tex.first;
-                       mtex->size[0] = mtex->size[1] = mtex->size[2] = 50;
+                       Tex *tex = G.main->tex.first;
+                       if(tex->type) {
+                               mtex = MEM_callocN(sizeof(MTex), "test mtex");
+                               ts->sculpt->brush->texact = 0;
+                               ts->sculpt->brush->mtex[0] = mtex;
+                               mtex->tex = tex;
+                               mtex->size[0] = mtex->size[1] = mtex->size[2] = 50;
+                       }
                }
 
                ED_undo_push(C, "Enter sculpt");
index 532b599f786c3b04e949e0627b6559acbb99ab57..e2b4506f377c70378b53ff556878354ace18dcaa 100644 (file)
@@ -244,6 +244,7 @@ void RNA_def_texture(BlenderRNA *brna)
        PropertyRNA *prop;
 
        static EnumPropertyItem prop_type_items[] = {
+               {0, "NONE", "None", ""},
                {TEX_CLOUDS, "CLOUDS", "Clouds", ""},
                {TEX_WOOD, "WOOD", "Wood", ""},
                {TEX_MARBLE, "MARBLE", "Marble", ""},