Made WeightPaint use shaded mode. This thanks to the preparations as done
authorTon Roosendaal <ton@blender.org>
Sat, 24 Sep 2005 13:49:55 +0000 (13:49 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 24 Sep 2005 13:49:55 +0000 (13:49 +0000)
by daniel before. :)
Note; the shaded display uses smooth normals by default, because thats how
the derived mesh works!

Daniel; I've changed the G_WEIGHTPAINT hack in derivedmesh code... no idea
how this could work even. Still ugly though.

source/blender/blenkernel/intern/DerivedMesh.c
source/blender/makesdna/DNA_space_types.h
source/blender/src/drawobject.c
source/blender/src/drawoops.c
source/blender/src/oops.c

index 8d0b9e64cde380ad1b77f6d7a129e63a0bc77403..af995624c03ae47b5fb4d2a399557fbd4b8d5883 100644 (file)
@@ -544,7 +544,7 @@ static DerivedMesh *getMeshDerivedMesh(Mesh *me, Object *ob, float (*vertCos)[3]
        mdm->dm.release = meshDM_release;
 
                /* Works in conjunction with hack during modifier calc */
-       if (G.f & G_WEIGHTPAINT) {
+       if ((G.f & G_WEIGHTPAINT) && ob==OBACT) {
                mdm->wpaintMCol = MEM_dupallocN(me->mcol);
        }
 
@@ -1814,7 +1814,7 @@ static void mesh_build_data(Object *ob)
 
        clear_mesh_caches(ob);
 
-       if( (G.f & G_WEIGHTPAINT)) {
+       if( (G.f & G_WEIGHTPAINT) && ob==OBACT) {
                MCol *mcol = me->mcol;
                TFace *tface =  me->tface;
 
index 4b687d312c023269727cac2bc468833c00eb066a..1c28296964670d8642e8bb9f53ead1bd311379c1 100644 (file)
@@ -468,6 +468,7 @@ typedef struct SpaceImaSel {
 #define OOPS_LAY       1024
 #define OOPS_LI                2048
 #define OOPS_IM                4096
+#define OOPS_AR                8192
 
 /* SpaceOops->outlinevis */
 #define SO_ALL_SCENES  0
index 81b8eb34071a5046d09adf2d9ba41e4b5b5549be..e2e3d704073fa7a8791e2a86e36371f129f1d6ce 100644 (file)
@@ -1636,6 +1636,12 @@ static void draw_mesh_object_outline(Object *ob, DerivedMesh *dm)
        }
 }
 
+static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
+{
+       *drawSmooth_r = 1;
+       return 1;
+}
+
 static void draw_mesh_fancy(Object *ob, DerivedMesh *baseDM, DerivedMesh *dm, int dt)
 {
        Mesh *me = ob->data;
@@ -1693,7 +1699,13 @@ static void draw_mesh_fancy(Object *ob, DerivedMesh *baseDM, DerivedMesh *dm, in
        }
        else if(dt==OB_SHADED) {
                if( (G.f & G_WEIGHTPAINT)) {
-                       dm->drawMappedFaces(dm, NULL, NULL, 1);
+                       glEnable(GL_LIGHTING);
+                       glEnable(GL_COLOR_MATERIAL);
+                       set_gl_material(0);     // defmaterial settings
+
+                       dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1);
+                       glDisable(GL_LIGHTING);
+                       glDisable(GL_COLOR_MATERIAL);
                }
                else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) {
                        dm->drawMappedFaces(dm, NULL, NULL, 1);
index 8785024046f8f67aac02ad0b21430bf3eddb7ade..7b92bfde41304fa8794d8731090125c14e90b81d 100644 (file)
 #include "BSE_drawipo.h"
 #include "BSE_drawoops.h"
 
-#include "BKE_depsgraph.h"
-
-extern void build_deps(short mask);
-//extern void draw_deps(DagNode *node);
-
-
 float oopscalex;
 
 void boundbox_oops()
@@ -404,17 +398,9 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
        if(soops==0) return;    
        
        if(soops->type==SO_OUTLINER) draw_outliner(sa, soops);
-       else if (soops->type==SO_DEPSGRAPH) {
-               build_deps(soops->deps_flags);
-               boundbox_deps();
-               calc_scrollrcts(sa,G.v2d, curarea->winx, curarea->winy);
-
-               myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
-               oopscalex= .14*((float)curarea->winx)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
-               calc_ipogrid(); /* for scrollvariables */
-               draw_all_deps();
-       } else {
+       else {
+               build_oops();   /* changed to become first call... */
+               
                boundbox_oops();
                calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
 
@@ -422,7 +408,6 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
 
                oopscalex= .14*((float)curarea->winx)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
                calc_ipogrid(); /* for scrollvariables */
-               build_oops();
 
                oops= soops->oops.first;
                while(oops) {
index ec219e32163485e685c65e09cc02daa51242e258..6c0efd27a2214e13afd390d9d1aabe2f8494fdec 100644 (file)
@@ -863,7 +863,7 @@ void build_oops()
 
        /* make oops, includes testing for existance */
 
-       /* awlays */    
+       /* always */    
        if(G.soops->visiflag & OOPS_LI) {
                Library *li= G.main->library.first;
                while(li) {