Revision: 27511
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27511
Author:   campbellbarton
Date:     2010-03-15 12:00:00 +0100 (Mon, 15 Mar 2010)

Log Message:
-----------
draw option to only display what is rendered, used for sequencer, opengl 
drawing by default. since we use preview renders a lot the empties & armatures 
can get in the way also.

Modified Paths:
--------------
    branches/render25/release/scripts/ui/space_view3d.py
    branches/render25/source/blender/blenkernel/BKE_global.h
    branches/render25/source/blender/editors/space_view3d/drawarmature.c
    branches/render25/source/blender/editors/space_view3d/drawobject.c
    branches/render25/source/blender/editors/space_view3d/view3d_draw.c
    branches/render25/source/blender/makesdna/DNA_view3d_types.h
    branches/render25/source/blender/makesrna/intern/rna_space.c

Modified: branches/render25/release/scripts/ui/space_view3d.py
===================================================================
--- branches/render25/release/scripts/ui/space_view3d.py        2010-03-15 
10:25:07 UTC (rev 27510)
+++ branches/render25/release/scripts/ui/space_view3d.py        2010-03-15 
11:00:00 UTC (rev 27511)
@@ -1899,9 +1899,11 @@
         ob = context.object
 
         col = layout.column()
-        col.prop(view, "display_x_axis", text="X Axis")
-        col.prop(view, "display_y_axis", text="Y Axis")
-        col.prop(view, "display_z_axis", text="Z Axis")
+        col.prop(view, "display_render_override")
+
+        col = layout.column()
+        display_all = not view.display_render_override
+        col.active = display_all
         col.prop(view, "outline_selected")
         col.prop(view, "all_object_origins")
         col.prop(view, "relationship_lines")
@@ -1910,9 +1912,17 @@
             col.prop(mesh, "all_edges")
 
         col = layout.column()
-        col.prop(view, "display_floor", text="Grid Floor")
+        col.active = display_all
+        split = col.split(percentage=0.55)
+        split.prop(view, "display_floor", text="Grid Floor")
+        
+        row = split.row(align=True)
+        row.prop(view, "display_x_axis", text="X", toggle=True)
+        row.prop(view, "display_y_axis", text="Y", toggle=True)
+        row.prop(view, "display_z_axis", text="Z", toggle=True)
+        
         sub = col.column(align=True)
-        sub.active = view.display_floor
+        sub.active = (display_all and view.display_floor)
         sub.prop(view, "grid_lines", text="Lines")
         sub.prop(view, "grid_spacing", text="Spacing")
         sub.prop(view, "grid_subdivisions", text="Subdivisions")

Modified: branches/render25/source/blender/blenkernel/BKE_global.h
===================================================================
--- branches/render25/source/blender/blenkernel/BKE_global.h    2010-03-15 
10:25:07 UTC (rev 27510)
+++ branches/render25/source/blender/blenkernel/BKE_global.h    2010-03-15 
11:00:00 UTC (rev 27511)
@@ -106,7 +106,7 @@
 #define G_RENDER_OGL   (1 <<  0)
 #define G_SWAP_EXCHANGE        (1 <<  1)
 /* also uses G_FILE_AUTOPLAY */
-#define G_RENDER_SHADOW        (1 <<  3)
+/* #define G_RENDER_SHADOW     (1 <<  3) */ /* temp flag, removed */
 #define G_BACKBUFSEL   (1 <<  4)
 #define G_PICKSEL              (1 <<  5)
 

Modified: branches/render25/source/blender/editors/space_view3d/drawarmature.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/drawarmature.c        
2010-03-15 10:25:07 UTC (rev 27510)
+++ branches/render25/source/blender/editors/space_view3d/drawarmature.c        
2010-03-15 11:00:00 UTC (rev 27511)
@@ -2406,7 +2406,7 @@
        bArmature *arm= ob->data;
        int retval= 0;
 
-       if(G.f & G_RENDER_SHADOW)
+       if(v3d->flag2 & V3D_RENDER_OVERRIDE)
                return 1;
        
        if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) {

Modified: branches/render25/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/drawobject.c  
2010-03-15 10:25:07 UTC (rev 27510)
+++ branches/render25/source/blender/editors/space_view3d/drawobject.c  
2010-03-15 11:00:00 UTC (rev 27511)
@@ -339,9 +339,6 @@
        float v1[3]= {0.0, 0.0, 0.0};
        float v2[3]= {0.0, 0.0, 0.0};
        float v3[3]= {0.0, 0.0, 0.0};
-
-       if(G.f & G_RENDER_SHADOW)
-               return;
        
        switch(drawtype) {
        
@@ -892,9 +889,6 @@
        float imat[4][4], curcol[4];
        char col[4];
        int drawcone= (dt>OB_WIRE && !(G.f & G_PICKSEL) && la->type == LA_SPOT 
&& (la->mode & LA_SHOW_CONE));
-
-       if(G.f & G_RENDER_SHADOW)
-               return;
        
        if(drawcone && !v3d->transp) {
                /* in this case we need to draw delayed */
@@ -1195,9 +1189,6 @@
        float nobmat[4][4], vec[8][4], fac, facx, facy, depth;
        int i;
 
-       if(G.f & G_RENDER_SHADOW)
-               return;
-
        cam= ob->data;
        
        glDisable(GL_LIGHTING);
@@ -2035,7 +2026,8 @@
        float area, col[3]; /* area of the face,  color of the text to draw */
        float grid= unit->system ? unit->scale_length : v3d->grid;
        int do_split= unit->flag & USER_UNIT_OPT_SPLIT;
-       if(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))
+
+       if(v3d->flag2 & V3D_RENDER_OVERRIDE)
                return;
 
        /* make the precision of the pronted value proportionate to the 
gridsize */
@@ -2456,8 +2448,7 @@
                                CHECK_OB_DRAWTEXTURE(v3d, dt))
        {
                int faceselect= (ob==OBACT && paint_facesel_test(ob));
-
-               if ((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && 
!(G.f&G_PICKSEL || paint_facesel_test(ob)) && !draw_wire) {
+               if ((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & 
V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !(G.f&G_PICKSEL || 
paint_facesel_test(ob)) && !draw_wire) {
                        draw_mesh_object_outline(v3d, ob, dm);
                }
 
@@ -2512,7 +2503,7 @@
                else {
                        Paint *p;
 
-                       if((v3d->flag&V3D_SELECT_OUTLINE) && 
(base->flag&SELECT) && !draw_wire && !ob->sculpt)
+                       if((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & 
V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire && !ob->sculpt)
                                draw_mesh_object_outline(v3d, ob, dm);
 
                        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & 
ME_TWOSIDED );
@@ -2596,7 +2587,7 @@
                                dm= mesh_get_derived_final(scene, ob, 
v3d->customdata_mask);
                        }
 
-                       if ((v3d->flag&V3D_SELECT_OUTLINE) && 
(base->flag&SELECT) && !draw_wire) {
+                       if ((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & 
V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire) {
                                draw_mesh_object_outline(v3d, ob, dm);
                        }
 
@@ -3766,7 +3757,8 @@
                                        setlinestyle(0);
                                }
 
-                               if((part->draw & PART_DRAW_NUM || part->draw & 
PART_DRAW_HEALTH) && !(G.f & G_RENDER_SHADOW)){
+
+                               if((part->draw & PART_DRAW_NUM || part->draw & 
PART_DRAW_HEALTH) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0){
                                        float vec_txt[3];
                                        char *val_pos= val;
                                        val[0]= '\0';
@@ -4857,9 +4849,6 @@
        int curcol;
        float size;
 
-       if(G.f & G_RENDER_SHADOW)
-               return;
-       
        /* XXX why? */
        if(ob!=scene->obedit && (ob->flag & SELECT)) {
                if(ob==OBACT) curcol= TH_ACTIVE;
@@ -5287,9 +5276,6 @@
        float eu[3]= {radsPerDeg*data->axX, radsPerDeg*data->axY, 
radsPerDeg*data->axZ};
        float mat[4][4];
 
-       if(G.f & G_RENDER_SHADOW)
-               return;
-
        eul_to_mat4(mat,eu);
        glLineWidth (4.0f);
        setlinestyle(2);
@@ -5555,7 +5541,7 @@
        }
        
        /* draw outline for selected solid objects, mesh does itself */
-       if((v3d->flag & V3D_SELECT_OUTLINE) && ob->type!=OB_MESH) {
+       if((v3d->flag & V3D_SELECT_OUTLINE) && ((v3d->flag2 & 
V3D_RENDER_OVERRIDE)==0) && ob->type!=OB_MESH) {
                if(dt>OB_WIRE && dt<OB_TEXTURE && (ob->mode & OB_MODE_EDIT)==0 
&& (flag & DRAW_SCENESET)==0) {
                        if (!(ob->dtx&OB_DRAWWIRE) && (ob->flag&SELECT) && 
!(flag&DRAW_PICKING)) {
                                
@@ -5689,44 +5675,60 @@
                        break;
                }
                case OB_EMPTY:
-                       drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype);
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+                               drawaxes(ob->empty_drawsize, flag, 
ob->empty_drawtype);
                        break;
                case OB_LAMP:
-                       drawlamp(scene, v3d, rv3d, base, dt, flag);
-                       if(dtx || (base->flag & SELECT)) 
glMultMatrixf(ob->obmat);
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+                               drawlamp(scene, v3d, rv3d, base, dt, flag);
+                               if(dtx || (base->flag & SELECT)) 
glMultMatrixf(ob->obmat);
+                       }
                        break;
                case OB_CAMERA:
-                       drawcamera(scene, v3d, rv3d, ob, flag);
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+                               drawcamera(scene, v3d, rv3d, ob, flag);
                        break;
                case OB_LATTICE:
-                       drawlattice(scene, v3d, ob);
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+                               drawlattice(scene, v3d, ob);
+                       }
                        break;
                case OB_ARMATURE:
-                       if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use 
default material
-                       empty_object= draw_armature(scene, v3d, ar, base, dt, 
flag);
-                       if(dt>OB_WIRE) GPU_disable_material();
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+                               if(dt>OB_WIRE) GPU_enable_material(0, NULL); // 
we use default material
+                               empty_object= draw_armature(scene, v3d, ar, 
base, dt, flag);
+                               if(dt>OB_WIRE) GPU_disable_material();
+                       }
                        break;
                default:
-                       drawaxes(1.0, flag, OB_ARROWS);
+                       if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+                               drawaxes(1.0, flag, OB_ARROWS);
+                       }
        }
-       if(ob->soft /*&& flag & OB_SBMOTION*/){
-               float mrt[3][3],msc[3][3],mtr[3][3]; 
-               SoftBody *sb = 0;
-               float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f;
-               if ((sb= ob->soft)){
-                       if(sb->solverflags & SBSO_ESTIMATEIPO){
 
-                               glLoadMatrixf(rv3d->viewmat);
-                               copy_m3_m3(msc,sb->lscale);
-                               copy_m3_m3(mrt,sb->lrot);
-                               mul_m3_m3m3(mtr,mrt,msc); 
-                               
ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize);
-                               glMultMatrixf(ob->obmat);
+               if((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+
+               if(ob->soft /*&& flag & OB_SBMOTION*/){
+                       float mrt[3][3],msc[3][3],mtr[3][3]; 
+                       SoftBody *sb = 0;
+                       float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f;
+                       if ((sb= ob->soft)){
+                               if(sb->solverflags & SBSO_ESTIMATEIPO){
+
+                                       glLoadMatrixf(rv3d->viewmat);
+                                       copy_m3_m3(msc,sb->lscale);
+                                       copy_m3_m3(mrt,sb->lrot);
+                                       mul_m3_m3m3(mtr,mrt,msc); 
+                                       
ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize);
+                                       glMultMatrixf(ob->obmat);
+                               }
                        }
                }
-       }
 
-       if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob, rv3d);
+        if(ob->pd && ob->pd->forcefield) {
+            draw_forcefield(scene, ob, rv3d);
+        }
+    }
 
        /* code for new particle system */
        if(             (warning_recursive==0) &&
@@ -5883,7 +5885,8 @@
                }
        }
 
-       {
+    if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+
                bConstraint *con;
                for(con=ob->constraints.first; con; con= con->next) 
                {
@@ -5894,24 +5897,25 @@
                                        drawRBpivot(data);
                        }
                }
-       }
 
-       /* draw extra: after normal draw because of makeDispList */
-       if(dtx && !(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))) {
-               if(dtx & OB_AXIS) {
-                       drawaxes(1.0f, flag, OB_ARROWS);
-               }
-               if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob);
-               if(dtx & OB_TEXSPACE) drawtexspace(ob);
-               if(dtx & OB_DRAWNAME) {
-                       /* patch for several 3d cards (IBM mostly) that crash 
on glSelect with text drawing */
-                       /* but, we also dont draw names for sets or duplicators 
*/
-                       if(flag == 0) {
-                               view3d_cached_text_draw_add(0.0f, 0.0f, 0.0f, 
ob->id.name+2, 10, 0);
-                       }
-               }
-               /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
-               if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, 
rv3d, ob);
+        /* draw extra: after normal draw because of makeDispList */
+        if(dtx && (G.f & G_RENDER_OGL)==0) {
+        
+            if(dtx & OB_AXIS) {

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to