Matcap fix:
authorTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 12:36:06 +0000 (12:36 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 12:36:06 +0000 (12:36 +0000)
Setting Cycles as render engine skipped matcap drawing.
Logic for checking drawing types needed a shuffle.

source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c

index 22bf605168dea80838b5f5f2a25a0525c168b502..70e2e663b3356f8ae515043126fd7c22859c3d6e 100644 (file)
@@ -940,7 +940,8 @@ static int tex_mat_set_face_editmesh_cb(void *userData, int index)
 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                         Object *ob, DerivedMesh *dm, const int draw_flags)
 {
-       if ((!BKE_scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW)) {
+       /* if not cycles, or preview-modifiers, or drawing matcaps */
+       if ((!BKE_scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW) || (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)) {
                draw_mesh_textured_old(scene, v3d, rv3d, ob, dm, draw_flags);
                return;
        }
index 63ffe54aeedd6911ad9a3d984ef14cd5e8e67c38..b3f022d8870b9cf55471deb9b44570786a2ddf71 100644 (file)
@@ -176,10 +176,13 @@ static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
                return TRUE;
 
        /* textured solid */
-       if (v3d->drawtype == OB_SOLID && (v3d->flag2 & (V3D_SOLID_TEX | V3D_SHOW_SOLID_MATCAP))
+       if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX)
                && !BKE_scene_use_new_shading_nodes(scene))
                        return TRUE;
        
+       if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
+               return 1;
+       
        return FALSE;
 }
 
@@ -218,12 +221,13 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, const char dt)
                return 0;
        if (ob == OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
                return 0;
-       if (BKE_scene_use_new_shading_nodes(scene))
-               return 0;
        
        if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
                return 1;
        
+       if (BKE_scene_use_new_shading_nodes(scene))
+               return 0;
+       
        return (scene->gm.matmode == GAME_MAT_GLSL) && (dt > OB_SOLID);
 }