Revision: 25438
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25438
Author:   blendix
Date:     2009-12-17 15:38:30 +0100 (Thu, 17 Dec 2009)

Log Message:
-----------
Fix #20374: Limit selection to visible would not work anymore after trying to
select once but not selecting correctly, due the need backbuffer flag not being
reset correctly in the 3d view.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/mesh/editface.c
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
    trunk/blender/source/blender/makesdna/DNA_view3d_types.h
    trunk/blender/source/blender/windowmanager/intern/wm_draw.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2009-12-17 
13:27:52 UTC (rev 25437)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2009-12-17 
14:38:30 UTC (rev 25438)
@@ -5059,6 +5059,7 @@
                        if (sl->spacetype==SPACE_VIEW3D) {
                                View3D *v3d= (View3D*) sl;
                                v3d->bgpic= newdataadr(fd, v3d->bgpic);
+                               v3d->flag |= V3D_INVALID_BACKBUF;
                                if(v3d->bgpic)
                                        v3d->bgpic->iuser.ok= 1;
                                if(v3d->gpd) {

Modified: trunk/blender/source/blender/editors/mesh/editface.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editface.c        2009-12-17 
13:27:52 UTC (rev 25437)
+++ trunk/blender/source/blender/editors/mesh/editface.c        2009-12-17 
14:38:30 UTC (rev 25438)
@@ -127,7 +127,7 @@
        if (!me || me->totface==0)
                return 0;
 
-// XXX         if (v3d->flag & V3D_NEEDBACKBUFDRAW) {
+// XXX         if (v3d->flag & V3D_INVALID_BACKBUF) {
 // XXX drawview.c!             check_backbuf();
 // XXX         persp(PERSP_VIEW);
 // XXX         }

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c     
2009-12-17 13:27:52 UTC (rev 25437)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c     
2009-12-17 14:38:30 UTC (rev 25438)
@@ -1113,11 +1113,11 @@
        else if((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) && 
v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
        else if(scene->obedit && v3d->drawtype>OB_WIRE && (v3d->flag & 
V3D_ZBUF_SELECT));
        else {
-               v3d->flag &= ~V3D_NEEDBACKBUFDRAW;
+               v3d->flag &= ~V3D_INVALID_BACKBUF;
                return;
        }
 
-       if( !(v3d->flag & V3D_NEEDBACKBUFDRAW) ) return;
+       if( !(v3d->flag & V3D_INVALID_BACKBUF) ) return;
 
 //     if(test) {
 //             if(qtest()) {
@@ -1162,7 +1162,7 @@
                draw_object_backbufsel(scene, v3d, rv3d, base->object);
        }
 
-       v3d->flag &= ~V3D_NEEDBACKBUFDRAW;
+       v3d->flag &= ~V3D_INVALID_BACKBUF;
 
        G.f &= ~G_BACKBUFSEL;
        v3d->zbuf= FALSE; 
@@ -1183,7 +1183,7 @@
 
 void view3d_validate_backbuf(ViewContext *vc)
 {
-       if(vc->v3d->flag & V3D_NEEDBACKBUFDRAW)
+       if(vc->v3d->flag & V3D_INVALID_BACKBUF)
                backdrawview3d(vc->scene, vc->ar, vc->v3d);
 }
 
@@ -2188,24 +2188,7 @@
        
        /* XXX here was the blockhandlers for floating panels */
 
-       if(ob && ob->mode & 
(OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) {
-               v3d->flag |= V3D_NEEDBACKBUFDRAW;
-               // XXX addafterqueue(ar->win, BACKBUFDRAW, 1);
-       }
-
-       if((ob && ob->mode & OB_MODE_PARTICLE_EDIT) && v3d->drawtype>OB_WIRE && 
(v3d->flag & V3D_ZBUF_SELECT)) {
-               v3d->flag |= V3D_NEEDBACKBUFDRAW;
-               // XXX addafterqueue(ar->win, BACKBUFDRAW, 1);
-       }
-
-       // test for backbuf select
-       if(scene->obedit && v3d->drawtype>OB_WIRE && (v3d->flag & 
V3D_ZBUF_SELECT)) {
-               
-               v3d->flag |= V3D_NEEDBACKBUFDRAW;
-               // XXX if(afterqtest(ar->win, BACKBUFDRAW)==0) {
-               //      addafterqueue(ar->win, BACKBUFDRAW, 1);
-               //}
-       }
+       v3d->flag |= V3D_INVALID_BACKBUF;
 }
 
 

Modified: trunk/blender/source/blender/makesdna/DNA_view3d_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_view3d_types.h    2009-12-17 
13:27:52 UTC (rev 25437)
+++ trunk/blender/source/blender/makesdna/DNA_view3d_types.h    2009-12-17 
14:38:30 UTC (rev 25438)
@@ -190,7 +190,7 @@
 #define V3D_DISPIMAGE          1
 #define V3D_DISPBGPIC          2
 #define V3D_HIDE_HELPLINES     4
-#define V3D_NEEDBACKBUFDRAW    8
+#define V3D_INVALID_BACKBUF    8
 #define V3D_EDITMODE           16
 #define V3D_VERTEXPAINT                32
 #define V3D_FACESELECT         64

Modified: trunk/blender/source/blender/windowmanager/intern/wm_draw.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_draw.c 2009-12-17 
13:27:52 UTC (rev 25437)
+++ trunk/blender/source/blender/windowmanager/intern/wm_draw.c 2009-12-17 
14:38:30 UTC (rev 25438)
@@ -34,6 +34,7 @@
 #include "DNA_screen_types.h"
 #include "DNA_windowmanager_types.h"
 #include "DNA_userdef_types.h"
+#include "DNA_view3d_types.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -90,6 +91,12 @@
        }
 }
 
+static void wm_area_mark_invalid_backbuf(ScrArea *sa)
+{
+       if(sa->spacetype == SPACE_VIEW3D)
+               ((View3D*)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF;
+}
+
 /********************** draw all **************************/
 /* - reference method, draw all each time                 */
 
@@ -113,6 +120,7 @@
                        }
                }
                
+               wm_area_mark_invalid_backbuf(sa);
                CTX_wm_area_set(C, NULL);
        }
 
@@ -230,6 +238,7 @@
                        }
                }
                
+               wm_area_mark_invalid_backbuf(sa);
                CTX_wm_area_set(C, NULL);
        }
 
@@ -553,6 +562,7 @@
                        }
                }
                
+               wm_area_mark_invalid_backbuf(sa);
                CTX_wm_area_set(C, NULL);
        }
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to