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:
authorNicholas Bishop <nicholasbishop@gmail.com>2006-11-06 04:08:26 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2006-11-06 04:08:26 +0300
commit8e97a2955b2f99ec61189cb972c09676a013a60b (patch)
tree89e67578ceac5a670a309b72295156cbfc7f05c7 /source/blender/src/buttons_shading.c
parent6feb2cc4f6d4c2131b959b77a8b87a5d7c9412a4 (diff)
Merged Google Summer of Code sculptmode/multires/retopo tools.
From the tracker: https://projects.blender.org/tracker/index.php?func=detail&aid=5018&group_id=9&atid=127
Diffstat (limited to 'source/blender/src/buttons_shading.c')
-rw-r--r--source/blender/src/buttons_shading.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 20eeb4f7532..fdfa17fc858 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -1218,7 +1218,7 @@ static void texture_panel_colors(Tex *tex)
}
-static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br)
+static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br, SculptData *sd)
{
MTex *mt=NULL;
uiBlock *block;
@@ -1240,6 +1240,7 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
else if(wrld) idfrom= &wrld->id;
else if(la) idfrom= &la->id;
else if(br) idfrom= &br->id;
+ else if(sd) idfrom= NULL; /* Not sure what this does */
else idfrom= NULL;
uiBlockSetCol(block, TH_BUT_SETTING2);
@@ -1255,6 +1256,9 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
else if(br) {
std_libbuttons(block, 10, 180, 0, NULL, B_BTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->menunr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
}
+ else if(sd) {
+ std_libbuttons(block, 10, 180, 0, NULL, B_SCULPT_TEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
+ }
else if(node) {
}
@@ -1272,6 +1276,7 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
else if(wrld) mt= wrld->mtex[a];
else if(la) mt= la->mtex[a];
else if(br) mt= br->mtex[a];
+ else if(sd) mt= sd->mtex[a];
if(mt && mt->tex) splitIDname(mt->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -1293,6 +1298,10 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(br->texact), 0.0, (float)a, 0, 0, "");
yco-= 20;
}
+ else if(sd) {
+ uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(sd->texact), 0.0, (float)a, 0, 0, "");
+ yco-= 20;
+ }
}
uiBlockEndAlign(block);
}
@@ -1335,7 +1344,7 @@ static void texture_panel_preview(MTex *mtex, int preview)
uiDefButC(block, ROW, B_TEXREDR_PRV, "Mat", 200,175,80,25, &G.buts->texfrom, 3.0, 0.0, 0, 0, "Displays the textures of the active material");
uiDefButC(block, ROW, B_TEXREDR_PRV, "World", 200,150,80,25, &G.buts->texfrom, 3.0, 1.0, 0, 0, "Displays the textures of the world block");
uiDefButC(block, ROW, B_TEXREDR_PRV, "Lamp", 200,125,80,25, &G.buts->texfrom, 3.0, 2.0, 0, 0, "Displays the textures of the selected lamp");
- uiDefButC(block, ROW, B_TEXREDR_PRV, "Brush", 200,100,80,25, &G.buts->texfrom, 3.0, 3.0, 0, 0, "Displays the textures of the selected lamp");
+ uiDefButC(block, ROW, B_TEXREDR_PRV, "Brush", 200,100,80,25, &G.buts->texfrom, 3.0, 3.0, 0, 0, "Displays the textures of the selected brush");
uiBlockEndAlign(block);
if(mtex && mtex->tex)
@@ -3459,6 +3468,7 @@ void texture_panels()
{
Material *ma=NULL;
Brush *br=NULL;
+ SculptData *sd=NULL;
Lamp *la=NULL;
World *wrld=NULL;
bNode *node=NULL;
@@ -3492,16 +3502,23 @@ void texture_panels()
}
}
else if(G.buts->texfrom==3) {
- br= G.scene->toolsettings->imapaint.brush;
- if(br) mtex= br->mtex[br->texact];
+ if(G.f & G_SCULPTMODE) {
+ sd= &G.scene->sculptdata;
+ if(sd->texact != -1)
+ mtex= sd->mtex[sd->texact];
+ }
+ else {
+ br= G.scene->toolsettings->imapaint.brush;
+ if(br) mtex= br->mtex[br->texact];
+ }
}
- texture_panel_preview(mtex, ma || wrld || la || br || node); // for 'from' buttons
+ texture_panel_preview(mtex, ma || wrld || la || br || node || sd); // for 'from' buttons
- if(ma || wrld || la || br || node) {
+ if(ma || wrld || la || br || node || sd) {
Tex *tex= NULL;
- texture_panel_texture(mtex, ma, wrld, la, node, br);
+ texture_panel_texture(mtex, ma, wrld, la, node, br, sd);
if(mtex) tex= mtex->tex;
else if(node) tex= (Tex *)node->id;