Added some code in sculpt and RNA for textures with type none. Hopefully fixes the problem with sculpt not working in 2.5.

This commit is contained in:
Nicholas Bishop
2009-01-26 21:32:22 +00:00
parent 5df6f4d257
commit 63cedd8bd8
2 changed files with 9 additions and 5 deletions

View 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");

View 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", ""},