[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27551] trunk/blender: draw option to only display what is rendered, used for sequencer, opengl drawing by default.
Brecht Van Lommel
brecht at blender.org
Tue Mar 16 18:49:31 CET 2010
Revision: 27551
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27551
Author: blendix
Date: 2010-03-16 18:49:31 +0100 (Tue, 16 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.
(commit 27511 by Campbell from render25 branch)
Modified Paths:
--------------
trunk/blender/release/scripts/ui/space_view3d.py
trunk/blender/source/blender/blenkernel/BKE_global.h
trunk/blender/source/blender/editors/space_view3d/drawarmature.c
trunk/blender/source/blender/editors/space_view3d/drawobject.c
trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
trunk/blender/source/blender/makesdna/DNA_view3d_types.h
trunk/blender/source/blender/makesrna/intern/rna_space.c
Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py 2010-03-16 17:45:01 UTC (rev 27550)
+++ trunk/blender/release/scripts/ui/space_view3d.py 2010-03-16 17:49:31 UTC (rev 27551)
@@ -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: trunk/blender/source/blender/blenkernel/BKE_global.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_global.h 2010-03-16 17:45:01 UTC (rev 27550)
+++ trunk/blender/source/blender/blenkernel/BKE_global.h 2010-03-16 17:49:31 UTC (rev 27551)
@@ -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: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c 2010-03-16 17:45:01 UTC (rev 27550)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c 2010-03-16 17:49:31 UTC (rev 27551)
@@ -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: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-03-16 17:45:01 UTC (rev 27550)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-03-16 17:49:31 UTC (rev 27551)
@@ -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) {
@@ -864,9 +861,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 */
@@ -1164,9 +1158,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);
@@ -2004,7 +1995,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 */
@@ -2425,8 +2417,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);
}
@@ -2481,7 +2472,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 );
@@ -2565,7 +2556,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);
}
@@ -3734,7 +3725,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';
@@ -4945,9 +4937,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;
@@ -5375,9 +5364,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);
@@ -5643,7 +5629,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)) {
@@ -5777,44 +5763,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) &&
@@ -5971,7 +5973,8 @@
}
}
- {
+ if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+
bConstraint *con;
for(con=ob->constraints.first; con; con= con->next)
{
@@ -5982,24 +5985,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) {
+ drawaxes(1.0f, flag, OB_ARROWS);
+ }
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list