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:
authorTon Roosendaal <ton@blender.org>2006-11-12 12:14:43 +0300
committerTon Roosendaal <ton@blender.org>2006-11-12 12:14:43 +0300
commitc8a8760c419e6719307447c5279efa0029bb526e (patch)
tree99e1f918e175356004f3d5d43550d2b92e74d6fe /source/blender/src/drawmesh.c
parent328e032ab0ae771ce30e6f58f4b3cebfde21d97b (diff)
Simple & efficient feature request from Campbell;
One of the annoying things in Blender was that the UV Faceselect mode immediately forced the object to draw 'Textured', mimicing how the game engine could show it. For modeling and texturing workflow not optimal. UV FaceSelect mode now draws textured & default lighted, if the view is set to 'Solid'. Switch view to 'Textured' to see again what the game engine could draw (which is using real lamps, and the per-face lighted flag).
Diffstat (limited to 'source/blender/src/drawmesh.c')
-rw-r--r--source/blender/src/drawmesh.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c
index 727a6ae744e..a6e91169af2 100644
--- a/source/blender/src/drawmesh.c
+++ b/source/blender/src/drawmesh.c
@@ -819,7 +819,7 @@ static int set_draw_settings_cached(int clearcache, int textured, TFace *texface
}
if (texface) {
- lit = lit && (texface->mode&TF_LIGHT);
+ lit = lit && (lit==-1 || texface->mode&TF_LIGHT);
textured = textured && (texface->mode&TF_TEX);
doublesided = texface->mode&TF_TWOSIDE;
} else {
@@ -878,6 +878,7 @@ static Object *g_draw_tface_mesh_ob = NULL;
static int g_draw_tface_mesh_islight = 0;
static int g_draw_tface_mesh_istex = 0;
static unsigned char g_draw_tface_mesh_obcol[4];
+
static int draw_tface__set_draw(TFace *tface, int matnr)
{
if (tface && ((tface->flag&TF_HIDE) || (tface->mode&TF_INVISIBLE))) return 0;
@@ -897,6 +898,7 @@ static int draw_tface__set_draw(TFace *tface, int matnr)
return 1; /* Set color from tface */
}
}
+
static int draw_tface_mapped__set_draw(void *userData, int index)
{
Mesh *me = (Mesh*)userData;
@@ -911,7 +913,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
{
unsigned char obcol[4];
int a;
- short islight, istex;
+ short istex, solidtex=0;
DerivedMesh *dm;
int dmNeedsFree;
@@ -921,7 +923,13 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
glShadeModel(GL_SMOOTH);
- islight= set_gl_light(ob);
+ /* option to draw solid texture with default lights */
+ if(dt>OB_WIRE && G.vd->drawtype==OB_SOLID) {
+ solidtex= 1;
+ g_draw_tface_mesh_islight= -1;
+ }
+ else
+ g_draw_tface_mesh_islight= set_gl_light(ob);
obcol[0]= CLAMPIS(ob->col[0]*255, 0, 255);
obcol[1]= CLAMPIS(ob->col[1]*255, 0, 255);
@@ -934,16 +942,15 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
else glFrontFace(GL_CCW);
glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
- if(G.vd->drawtype==OB_TEXTURE) istex= 1;
+ if(solidtex || G.vd->drawtype==OB_TEXTURE) istex= 1;
else istex= 0;
g_draw_tface_mesh_ob = ob;
- g_draw_tface_mesh_islight = islight;
g_draw_tface_mesh_istex = istex;
memcpy(g_draw_tface_mesh_obcol, obcol, sizeof(obcol));
set_draw_settings_cached(1, 0, 0, 0, 0, 0, 0);
- if(dt > OB_SOLID) {
+ if(dt > OB_SOLID || g_draw_tface_mesh_islight==-1) {
TFace *tface= me->tface;
MFace *mface= me->mface;
bProperty *prop = get_property(ob, "Text");